How to make good projectiles

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Hello! So I want make a good projectile that will move smooth and detect hit smooth too.

  2. What is the issue? I would like to know if there any easy way to make it. If there no way for it then tell me the best one.

  3. What solutions have you tried so far? First I was making projectile on server script which wasn’t very smooth. Second I was making a projectile on client side (i was firing all clients) and if detected hit it fires server remote to damage a target. The only problem was is that only players that have this local script that creates projectile or event will see the projectile which is bad.

I have an idea of creating a folder inside of player scripts full of local scripts that working with current projectile (in example 1 with fireball and other with a knife throw) and remote events in the replicated storage. But I want to know if there any better way.

1 Like

Have you heard about network ownership:
Network Ownership (roblox.com)

1 Like

An useful model for projectiles

2 Likes

Projectiles should always be created on the client. When the client fires their weapon create the projectile, then tell the server the player fired a shot. Projectiles should always just be visual effects. The server controls hit detection only and and tells all other clients to create a projectile coming from a certain position. I recommend using fast cast as it does not require a projectile instance and it still simulates the projectile flight time and velocity.

2 Likes

Thanks! I knew about fastcast before but was scared of it. Thank you that pushed me up to learning it.

Just so you know you can shorten links like this before sharing them (only the ID of the asset is required) Roblox will redirect you to the correct URL if necessary.

How does the server recognise the projectile to make a hit detection if the projectile is made on client?

E.g. for a fireball how does it work if you don’t mind explaining, thanks

The projectile should never be used for hit detection. FastCast is the module I use (although I usually modify it to my liking) and instead of a physics based projectile it instead CFrames a part every frame to give the illusion that the projectile is going to register the hit. FastCast does not need a projectile to work, so you can fire from the same position in the same direction on the client and server.

1 Like