- Home /
I don't understand how to use Vector3.reflect in Unity2D
I need to create a Ricochet effect between a bullet and a shield. I don't understand if I have to use this in my bullet or my shield I don't understand what does inDirection take in.
In general I already looked at the forums and I still don't understand. Help is appreciated.
I am talking about if it takes direction or velocity, how to reference it and also how to change speed
inDirection
can be a direction or a velocity.
If you want to decrease the velocity after impact, multiply the output vector by a "deceleration" factor (0.95f for instance)
Answer by jinoh · Dec 24, 2019 at 05:24 PM
you can use like this "Vector2.Reflect(v1,v2)" v1 means the move direction of bullet and v2 means a Vector which is perpenticular to your shield surface
How can I get the normal of my shield, which would be v2?
Your answer
Follow this Question
Related Questions
How to limit the distance to Half of the Circle from its actual raidus 2 Answers
How can I calculate the Vector3 b using Vector 3 a pos with an angle? 1 Answer
Round a Vector3 to a grid position? 2 Answers
[newbie] Vector3.Reflect not working properly. Please help 0 Answers
Ricochet Trajectories C# 1 Answer