- Home /
Directional booster
Well, I have a platform with an arrow, and a player, I want that when the player triggers the platform, him receive a force in the arrow direction, only in Z rotation. So, if arrow have a (0,0,0) rotation, the player needs to boost in (0,0,1) direction, if arrow is (0,0,180) the direction needs to be (0,0,-1). sorry if my english is bad thanks in advance
Answer by Joxno · Aug 12, 2014 at 04:19 PM
The easy way of accomplishing this is to identify in which directional vector the forefront of the arrow lays. So if the arrows forward pointing direction is Object.transform.forward then all you have to do is:
Player.GetComponent<Rigidbody>().AddForce(Arrow.transform.forward * Force);
Which should add a force in the specified forward direction in relation to the arrow.
Your answer
Follow this Question
Related Questions
Rotate object based on hit normal + matching camera direction 0 Answers
Rotate an object so its up vector matches a sphere 1 Answer
Quaternion values at instantiation. 1 Answer
quaternion - rotate camera based on original facing at scene start? 0 Answers
Follow rotation on Y axis ONLY clockwise/counterclockwise. 1 Answer