- Home /
Unity Impact Effect Wrong Rotation
Hi, I couldn't find an answer for this anywhere but I am shooting a bullet not using raycasts and instantiating an impact effect with Instantiate(concreteInpact, transform.position, Quaternion.identity); But the impact effect is always looking up.
I know that quaternion.idenity doesnt work, however I don't know what else to use.
Thanks!
Answer by finnjwohner · Jul 14, 2020 at 06:01 PM
You'll want to get the normal of the collision, then use something like Quaternion.LookRotation() to make the impact face in that direction instead of Quaternion.identity.
Thanks I will try that out! But what does getting the normal do? Like what does normal mean?
A normal is just a line that's perpendicular to another line, drew something really quickly in paint, where the red line is the normal to the black line and vice versa, to make it easier to visualise.
To get it, if you're using OnCollisionEnter(Collision other), you could use other.contacts[0].normal and that would give you the normal to your collision as a Vector3.
Your answer
Follow this Question
Related Questions
Bullet impact effect not working. Made from a Brackeys tutorial 2 Answers
Calculating a bullet time of impact based on speed and distance 1 Answer
How to add impact sparks / blood effects to 2D shooter? 2 Answers
How to make a bullet explode on impact 2 Answers
How can I rotate an object towards a collision normal in 2D? 0 Answers