Skip to content

Instantly share code, notes, and snippets.

View 6053373-stack's full-sized avatar

Sam Cowlin 6053373-stack

  • Joined Oct 8, 2025
View GitHub Profile
@6053373-stack
6053373-stack / SimplePlayerController.cs
Created October 16, 2025 10:19
One of the hardest things to make (in my opinion) is a player controller. So I decided to try my hand in making one. This is the product. It lacks the ability to jump however it makes use of Unity's new InputSystem that was introduced in Unity 6.0. .
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(Rigidbody))]
public class SimplePlayerController : MonoBehaviour
{
public float walkSpeed = 10.0f;
public float turnSpeed = 50.0f;
@6053373-stack
6053373-stack / SimpleDoor.cs
Created October 16, 2025 09:52
I attempted to create a "door" by having an object that would move from one position to another when ToggleDoor() is called. It works just not very well. This was made in Unity 6.2.
using UnityEngine;
public class SimpleDoor : MonoBehaviour
{
/*
* Anything can be a door if this script is used. When toggleDoor
* is true the object will move to it's doorOpenPosition or
* doorClosePosition.
*
* This script was made with the intention that you would use another
@6053373-stack
6053373-stack / ObjectSpawner.cs
Last active October 16, 2025 09:37
This was hastily made using Unity 6.2 and the main function of this script is to spawn an object with a random position. I have said this in the script but I just want to stress that you need to be careful with this as it does not do anything with the spawned objects so you should have a way to clear the spawned objects.
using UnityEngine;
public class ObjectSpawner : MonoBehaviour
{
/*
* PLEASE note that this does not do anything with the spawend objects.
*
* You should have a way to destroy excess spawned objects or you may flood your computer with them.
*/