3D FPS with bullet object instead of raycasting

How do I…

So in my project I currently use the 3d raycasting extension but I’m not really satisfied with it and instead I want to use a 3d object (Most likely a cube) as the bullet but I can’t figure out how to move it to where the camera aims. I may be just too stupid to figure it out. So basically when my character shoots I want to create a bullet object in the center of the player (Which is easy and I have already done) and I want it to move to where the 3D camera aimed at that moment (Which I don’t know how to do). I’m sorry if this was already asked and or answered!

1 Like

you have two choices
use my extension Forces and Positions
i recommend you not only because i need feedback or popularity but because it is easier

but you also can use these three formulas

setX + force * cos(ToRad(Angle2D)) * cos(ToRad(Angle3D))
setY + force * sin(ToRad(Angle2D)) * cos(ToRad(Angle3D))
setZ + force * sin(ToRad(-Angle3D))

force could be (40)
Angle2D could be (CameraAngle+90) -the offset is important-
Angle3D Could be (CameraRotationX+90) - the offset is important-

you could do based on object orientation aswell

Object.Angle()
Object.RotationY()
(no offset needed)

2 Likes

Hey thanks for answering I tried your extension since it seemed easier and it works with no problems for me. Thanks!