- Home /
Question by
elsharkawey · Feb 25 at 07:33 AM ·
jumpnavmeshagentjumping
player with a navmesh agent can't jump ? why ?
i working on a third person player using navmesh agent and when i use my code to jumping on the ground the player not jumping it's only moves forward on the floor without moving up in the sky direction from the floor
if(Input.GetKeyDown(KeyCode.Space)){
Vector3 startPos = navMeshAgent.transform.position;
Vector3 endPos = jumptarget.transform.position;
float time = 10f;
float height = 20f;
float duration = 10f;
while(time < 15f)
{
float upDist = height * (time - time * time);
//float upDist = 5f;
navMeshAgent.transform.position = Vector3.Lerp(startPos,endPos,time) + 40f * Vector3.up;
time += Time.deltaTime / duration;
Debug.Log("injumpthing");
return;
}
}
Comment
Your answer
Follow this Question
Related Questions
Can't jump with navmeshagent.. 0 Answers
How to force a player to jump? 2 Answers
Coyote Time/Ledge Assistance Causes Double Jump 4 Answers
Super Ghouls 'n Ghosts style jumps & double jumps? 1 Answer
I cant make my Character jump. 0 Answers