Firing Accurate Projectiles

So my “Fireball” won’t shoot accurately (and no the character doesn’t get in the way). I want to know how you guys make “Fireballs” fire accurately, and in full detail, because I’m a little new to projectiles. Anyone care to help?

I’ve tried using a bodymover/bodyvelocity, and setting a part to mousehit position, but that doesn’t always fire directly towards where I want it to go. Sometimes a part will get in the way, sometimes it will shoot nowhere near it’s target.

If I used camera lookvector, it may solve things however then the problem would be calculating from the camera to the mousehit position. a ray would probably solve this issue, but how would I make the velocity a ray? maybe i’m just overthinking things and there’s a simpler way to solve this issue. anyone know how?

3 Likes

when i make a projectile i most of the time use mouse.hit u said u had a problem with it touching your character? have u thought of setting the projectile cancollide off and make it so it will ignore your character? btw if u dont want it to hit you make it spawn farther from your torso

plr.Character.UpperTorso.CFrame = mouse.hit * CFrame.new(0,0,-6)

I reccomend checking out FastCast

As for how people normally fire projectiles, yes, they’re based on mouse hit position.

3 Likes

If the character is getting in the way, I would recommend using raycasting. Or just make it so that the Touched connection ignores the sender’s character.

1 Like

Reread my post and you should know I thought of that, though i’m confused with it.

I like your offer, but I would also like to make my own module of this and to do that I’d have to know how.

Wouldn’t setting the uppertorso’s CFrame cause you to tp instead?

You could read over how Fast cast is made.

Afaik the end result of using fast cast is:

On the server you fire a cast without a bullet (for hit detection) and then send information to replicated storage for bullet start point, end point, speed etc

On the client you render all the bullets (yours are rendered when you shoot with the tool however for “seamless gameplay”)

I hope this helps you understand how fire cast works so you can make a similar module.

1 Like