How can I move something towards the camera and beyond?

How can I move something that is on the scene to the direction of the camera? Like, I want a bullet that is on 3d space to get closer and closer to the camera and goes beyond so the user gets the feeling he is getting shot

Hi marcusx2,

I think you probably just want to do exactly what you described: take an object, move it toward the camera, then keep moving it until it’s past the camera. The following Playground shows an example.

Shoot at Camera Demo | Babylon.js Playground (babylonjs.com)

This approach is naive and unoptimized, but it’s straightforward and should at least roughly illustrate the various moving pieces. I’m not sure how much familiarity you may have with the techniques, so I added a whole bunch of comments that may or may not be useful at all. :upside_down_face: Hope this helps, and best of luck!

1 Like