- Home /
How player follow the weapon only when weapon at North east south and west, not in diagonal
How player follow where the weapon is only in North West South and East. I want if the weapon is on the right, the player is also moving on the right. but when the weapon is on diagonal position, then the player don't follow the weapon.I want the player move to the left right up or down. Not diagonal PLEASE ANSWER WITH C# CODE
Answer by jojo_game_studios · May 09, 2020 at 03:06 AM
Do you have any reference images or code? Otherwise I am envisioning a 2D top down shooter type thing
Here would be some code for that
//North if(weapon.transform.eulerangles.z == 0) { player.transform.position += Vector3.Up; } else if(weapon.transform.eulerangles.z == 90) { player.transform.position += Vector3.Right; } etc...
This is all I can give without reference images and code.
Your answer
Follow this Question
Related Questions
Camera rotation around player while following. 6 Answers
How can player follow where the weapon is? 1 Answer
How to Follow By Getting KeyDown? 0 Answers
Enemy is not stopping following the player 2 Answers
Smooth Camera 2D Follow Player 0 Answers