- Home /
 
error CS0122: `CharacterMotorC.SetVelocity(UnityEngine.Vector3)' is inaccessible due to its protection level
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);
     }
 }
 
               }
               Comment
              
 
               
              Answer by jakepe55 · Aug 13, 2015 at 11:43 PM
The CharacterMotor part didn't show up in the script on here.
Your answer
 
             Follow this Question
Related Questions
Instantiate object in C# 1 Answer
Multiple Cars not working 1 Answer
Using Lerp in a Constant Moving Object 1 Answer
What is wrong with this rigidbody? 2 Answers