- Home /
Rotate animation z coordinate to Equal Targets z Rotation.
I have this piece of code :-
if (collision.gameObject.name == "ground" ){
print("Hit the ground!!!");
Destroy(gameObject);
Instantiate( arrow1, lasthit , arrow1.transform.rotation);
}
Basically when the collision hits the "ground", an animation on a platform gets Instantiated so as to look like a shield coming out of the ground. ie( Disc Perpendicular to the ground) The problem I'm having is that the Rotations of the animation is pre-set. This means that, say if the character turns and shoots, the platform does not form facing him. I was trying to come up with some code that would set the z Rotation of the "arrow1" equal to the z Rotation of the character "Target", but I just ended up getting a headache :P This is my first time using javascript let alone Unity API so its probably going to be something ridiculously easy that I missed over-thinking the problem. Thanks for the Help, TwoHats. :P
Your answer
Follow this Question
Related Questions
Override animation in LateUpdate() 0 Answers
Do animation rotations refuse to accept negative values? 2 Answers
Manually animating using only rotations 0 Answers
Lookout Post Animation Problem 0 Answers
How to make One Arm Bandit? 1 Answer