Moving non-humanoid enemy via Tween

Currently I’m working on a tower defense style game. I’ve realized I’m using little features of the “Humanoid” for enemies so I’ve decided to not use them at all. Currently I’m moving enemies via Tween.

Currently, the HumanoidRootPart is tweened on the server, which looks like this
robloxapp-20211129-1802298.wmv (935.1 KB)
It’s kind of hard to tell from the video but the movement is very jittery so I’d like to tween from the client. How would I achieve this? Friendly towers shooting will be handled on the server, which while the client is handling movement it won’t replicate, leaving a bullet going to where the server thinks the enemy is.

I’m not looking for a whole system, just to be pushed in the right direction of what I’m trying to accomplish

Instead of attempting to tween the NPC’s which contain a Humanoid instance you should instead use the available :Move() and :MoveTo() methods which can be called through the Humanoid instance itself, they will allow for the NPC to move smoothly without necessitating the use of tweens. Also local movement of unanchored parts will replicate to the server.

I’m not using humanoids as it clearly says in the title. I also explained why

Although I can see where you possibly thought that, I’ll make it more clear I’m not using humanoids

Is the client also handling the positioning of the enemies? You would need to fire the enemies’ positions to the server very often. It would also be vulnerable to exploits so I wouldn’t recommend it.

No, I’m asking what I should do. Yes, currently my solution is to handle movement on the client but I would never send any info to the server that could be risky. I’m wondering if anyone has been in a similar situation even if it’s not a TDS game and has a solution or suggestions.

The jitter may be fixed by setting the networkownership to the client. If you still want to do it your way then you can tween an invisible part that represents the enemy on the server for the position.

I don’t think you understand my issue. I already know how to move the enemies, I just cannot find a very efficient way to have the server know where the enemies are if theyre being moved on the client. I need this info for when the enemy reaches a certain point to destroy them, shooting bullets at them, etc. I’m wondering if you know a good way to do this.

I explain this here:

Yes, the server can also tween, not the enemies(client does that) but an invisible part for each enemy. The server can detect the parts and destroy them, server can just let the client know that and have the enemy ‘die’.

1 Like

Hey, this would work, but this wouldn’t fully solve the problem. Tweening on the server is performance heavy and not a very good idea (definetely not in a tds game where there are many enemies at a time). This is why I’d like it done fully on the client (meaning I’m trying to not tween on the server at all), and hopefully find a way to predict where the clients enemy would be

I’ve come across this topic

which solves my issue

thanks for helping!