Is it possible (I think it is, I tested) to change animations client-sided?

I know it is, I tested it, and it worked for me. Now, I logged on with another account. It made me the default animation on the my side, and on their side it was another one. But on my side both of us were that animation. Not only him, but also me.
Im trying to recreate something like diep tanks
You see yourself as green, but others are red.

3 Likes

What kind of answer are you looking for? Don’t you already know that it’s possible since you tested it?

3 Likes

pst kyle, you need to help him change client sided atimations

3 Likes

Well, I managed to get it working using this entity script.

Each player sees their own unit with the “animation” animation, and sees other player’s units as having the default animation. Demo

This works since in entity scripts on units, setting actions to run on client only makes them run only for the player that owns the unit. I used the trigger “when this entity enters a region” because collisions are managed by the client physics engine when client-side prediction is on, so this script will successfully run on the client only when the unit enters a region. I have a region that covers the whole map so any unit that gets created anywhere in the map will collide with the region, triggering the script. I also made a boolean entity variable “first trigger” to only run an action on the second time triggering because the unit was triggering a collision with the region twice when created for some reason.

3 Likes

Seems that the players to join the game after you did, show the animation still, but if you join after someone, it works
image

2 Likes

Ok, I updated the script and added a new entity variable ‘client owns this unit’ to the unit type. Each client now keeps track of the unit that they control, and will not play the animation for newly created units if there is already a unit that they played the animation for. It should work fine now.

2 Likes