The bullet is composed of 3 attachments and 4 beams, all of which are moved in unison.
All particles are contained inside a single brick located at 0,0,0
Which is better?
TweenService on the bullet
Heartbeat CFrame
Wait() CFrame
RenderStep CFrame
BindToRenderStep CFrame (and if so, please supply which level to bind to)
Other way that is not mentioned here
Right now I plan on using TweenService, but I would like your input. Keep in mind that this server is meant to run over 100 players at once, so I need bullet performance to be as best as Lua can get.
Thoughts?
Edit: Yes I will be sure to only render bullets if they are visible on screen.
Never use any form of wait() when trying to tween. It’s inconsistent.
Of your listed methods, TweenService would be the best one, as it’s completely handled C++ side. However, if the bullet is physical, you may want to look into physics based moving, such as VectorForce (I think) and BodyMovers.
Also, just a tip, no need to create a brick at 0,0,0 (assuming that’s relative to the world), workspace.Terrain already extends BasePart with a position of that.
Yep I never use wait() anymore, just wanted to include that as an option so I listed all possible ones.
Additionally, I specifically want as little moving parts as possible, so using moving bullets are a no-go.
The reason I put a part at 0,0,0 is because it essentially allows me to put any number of particles in World Space via their attachments. A light in an attachment at a position of 0,5,3 would literally be at 0,5,3 in the world.
Lmao school wifi killing me for 15m trying to send this reply
Too taxing on CPU and memory to generate a tween and run it for such a short time per bullet
Heartbeat fires after the frame is rendered. Use RenderStepped for things to show up on the upcoming frame
Wait() falls out of sync with render.
Would be fine for a longer term animation
Yields render thread guranteeing movement but too taxing to bind and unbind to RenderStepped
You can do alot more if your fire rate is generally low, like a games such as Fortnite. (dont kill me for using it as an example) The bullet speed is generally way too fast for the client to render regardless. GTA leaves a bullet trail that fades away quickly, without an actual bullet ever being involved. Phantom Forces doesn’t involve any trail, until a certain range in which you can see a short pink flash, a part representing the bullet.
You mention that this needs to be efficient for the server which is making me worry that you want to animate these bullets serverside. The client should fire the bullet, let the server verify the data without any visual work, and have each client draw the bullet on their own. Damage is the only thing that should be calculated serverside.
I have no clue what all this magic talk is because I don’t have the time to properly read every reply. For now though, I’ll say; if you’re making projectiles, do not use TweenService to move the bullet. Fade sure, move no.