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: Unity Tutorial: Faux Gravity (walk on planets) - YouTube 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?