Hello. I made some magic fireballs that orbit a player when they’re using my staff weapon.
The problem is that these effects get offset when the player moves around, like so:
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.
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).
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.
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.
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.
I also don’t know how I would rotate welded parts without just changing their CFrame.