- Home /
how to make a bullet reflect off a wall?
I'm making a 2D game and I need bullets that move slowly and reflect off walls. I've looked everywhere and just cant find a simple answer.
Answer by Diukrone · Jan 20, 2018 at 06:24 PM
Try to put "Bounce" on phisics type. Just drag or select the physics to the serialize field. Maybe it Works. Don´t know. I am not conditionated about 2D or 2.5D games creation.
Answer by getyour411 · Jan 20, 2018 at 07:00 PM
See if you can adopt this:
https://answers.unity.com/questions/478017/what-is-a-raycasthit-normal.html
Answer by PersianKiller · Jan 20, 2018 at 07:16 PM
watch this tutorial , it's a simple example, it will give you the idea.
link of the tutorial.
Answer by FlightOfOne · Jan 20, 2018 at 09:24 PM
Everyone wants to reflect things off today :), just answered the same question.
You can use Vector2.Reflect:
Vector2 outboundDirection = Vector2.Reflect(_incomingDirection, _hitSurfaceNormal)
@FlightCrazed You said the same thing on my question and you still haven't answered, Where do I put that line in my script to make that work?
Your answer
Follow this Question
Related Questions
Bullets kill enemy... but continue to travel? 1 Answer
Bullet fires before direction change 0 Answers
Need hep with pooling(call Cs in Js) 0 Answers
Bullet Hole sprites don't align correctly on walls 2 Answers
how to have bullets produce particles? 2 Answers