Velocity move to mouse pos

Hello.
I want to make a my gun use velocity to move a bullet from the handle to my mouse position. i will be passing the mouse pos trough an remoteevent. how would i make the script fire the bullet with a code that looks like this:


		bullet.AssemblyLinearVelocity = script.Parent.CFrame.LookVector * BulletSpeed.Value

?

please help!

you want the bullet to move exactly where ur mouse is ingame? or just in that direction if that makes sense

also im confused on what ur asking for here

I would suggest a local script that handles the bullet visuals since if you are gonna get a lot of people shooting bullets it can affect the server side and make the game very laggy.

But wouldn’t you want to use BodyForce instead to make the bullet go where you clicked?

BodyForces are deprecated and the suggestion is to use VectorForces instead.

1 Like

Oh thank you, didn’t even see that it was deprecated my bad.

2 Likes

You can use RaycastParams instead, so like the bullet would start from inside the gun and then end up where the player’s mouse is clicking on. And once you set the RaycastResults, and you check to see if what the player actually shot is another character then you would could them receive damage.

Yes this is what i need. Please

Nevermore i had to use cf look at. Thanks for your time!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.