Orbiting particle effects don't keep up with moving character

Hello. I made some magic fireballs that orbit a player when they’re using my staff weapon.
spinnn

The problem is that these effects get offset when the player moves around, like so:
spinn_issue

I’m calculating the CFrame for each particle’s part every time RunService:Stepped() fires, but this clearly isn’t enough. How could I fix this issue? Should I use constraints, and if so which constraints would work best for this? Thanks.

1 Like

Would you like it to move exactly with the Player at all times, or just have a damped effect that’s less than what is happening now?

1 Like

The particles should stick right to the player.

1 Like

ParticleEmitter.LockToPart or ParticleEmitter.VelocityInheritance will do the job. If the particles are parts, make sure you do this on the client with RenderStepped (not Stepped).

1 Like

I found a post about rotating pets around a player that uses AlignPosition.

1 Like

The particles are meant to replicate to all players, so they have to be on the server.

1 Like

Not necessarily. You could and should make them for each client. Each client replicates particles for all characters, not just the local character.

1 Like

I could, but that sounds like an awful lot of work just for some particle effects. I know for a fact that constraints can keep the particles correctly around the player, I just have no idea how to make the particles weld onto the player while also allowing them to rotate and stay independent of the character’s orientation. I’ll probably follow your suggestion if all else fails.

1 Like

They’re working on this, so you don’t really need to do anything:

1 Like

I’m not sure I follow. How could I use this property to replicate particles across the clients?

Just change Script.RunContext to client and see if there’s any errors. If there is, attempt to fix them.

The script that handles the particles also handles the staff weapon’s server-side functionality, so that won’t work right off the bat. I tried moving the particle positioning to the client while keeping the particle creation on the server, which works perfectly for the player’s view, but obviously the particles don’t move in other clients. Using remote events has the same laggy effect as moving the particles on the server, so that isn’t worth it. The only solution I see would be to make a local script that logs every player using the staff and locally calculates the positioning for each player every frame. Again, sounds like quite a handful, but I suppose it could work.

You should make a Part with the particle effects on it, and then you add a weldconstraint on the part to the humanoidrootpart. Then you can make the part rotate as how you wanted it to spin. No need to use a loop or some sort to keep the part intact.

It should be massless too because the weld constraint will make you weirdly without it being on

You could update several characters for each client, not just the one.

1 Like

No, that would go against what I want to do. Like I said in a previous reply, welding the parts will make them follow the player’s orientation when I want them to be independent of it.
weld doesnt work lil bro

I also don’t know how I would rotate welded parts without just changing their CFrame.

Indeed, that is what I meant. Each client will calculate the positioning for all other clients.

1 Like

Have them on primarypart and just rotate the orientation, i dont know what the outcome would be. It shouldnt mess up the character or the weld.

Why not change the C0 of the weld?

it’s a weldconstraint not a weld