- Home /
Question by
TracksData · Feb 13, 2015 at 07:25 PM ·
c#playervector3y-axis
How to move the player upwards and forwards at the same time?
Hey, i'm new to unity and are trying to make a grappling hook so if the player shoot at the wall he will be dragged in a straight line to the position he shot at, I use this to move the player:
transform.Translate (Vector3.forward * Time.deltaTime * Speed);
But this only moves the player along the ground and not upwards if the player shoots on the wall, how can i make the player move upwards to? I'm coding in c#.
Thanks for all help :)
Comment
Answer by Doireth · Feb 13, 2015 at 07:26 PM
Try
transform.Translate ( (Vector3.forward + Vector3.up) * Time.deltaTime * Speed);
Thanks, i tried what you said but the player is now "jumping" along the ground, is there a way to turn of the First Person Controllers gravity from my c# script?
It works now, i just disable the character motor when moving the player, Thanks for helping me out :)