Unity 2017.1.0f3 AddRelativeForce Undefined error
So i have run into an issue when i try to use Addrelativeforce.
what i am trying to do is replace this bit of a thing I am working with: https://www.youtube.com/watch?v=gHeQ8Hr92P4 this thing, now the issue is that the original creator made it so the jumping was based on global directions rather than local ones so to character doesn't jump "up" but rather jumps up in regards to global directions
void Jump(){
GetComponent<Rigidbody>().AddForce(new Vector3(0,jumpStrength,0), ForceMode.VelocityChange);
grounded = false;
}
what i plan on doing is changing it from the above code to something like.
void Jump(){
GetComponent<Rigidbody>().AddReletiveForce(transform.up * jumpStrength);
grounded = false;
}
however when i do that i get the following error whenever i try to use addrelitive force: error CS1061: Type UnityEngine.Rigidbody' does not contain a definition for
AddReletiveForce' and no extension method AddReletiveForce' of type
UnityEngine.Rigidbody' could be found. Are you missing an assembly reference? i have no idea how to fix this, what do i do?
Answer by kawaishiru360 · Jan 01, 2019 at 09:03 PM
I found the issue, and this thing can be closed now.