Skip to content

Instantly share code, notes, and snippets.

@robochase6000
robochase6000 / CharacterMotor.cs
Last active March 11, 2019 20:21
FPSInputController & CharacterMotor for Unity 2018+
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class CharacterMotorSliding {
// Does the character slide on too steep surfaces?
public bool enabled = true;
// How fast does the character slide on steep surfaces?
public class SomeThing : MonoBehaviour
{
public MyPrefabReference PrefabReference;
void Awake()
{
Instantiate(PrefabReference);
}
}
using UnityEngine;
using System.Collections;
public class HandHitbox : MonoBehaviour
{
void OnTriggerEnter(Collider collider)
{
Interactable interactable = collider.GetComponent<Interactable> ();
if (interactable != null) {
interactable.TouchedBy (this);