I don’t understand why this error has popped up.
error CS0122: `CharacterMotorC.SetVelocity(UnityEngine.Vector3)’ is inaccessible due to its protection level
Heres my script:
using UnityEngine;
using System.Collections;
public class Bounce : MonoBehaviour {
public int strength = 100;
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == “Player”)
{
other.gameObject.GetComponent().SetVelocity(Vector3.up * strength);
}
}
}