Why does animation works on character but not on dummies?

Can anyone help me to understand why is it that when I use a LocalScript inside StarterPlayerScripts to play an animation on the player’s character, it works and it is replicated to all other players in the game.

But when I use the same LocalScript to play an animation on a dummy in the workspace, it is NOT replicated to other players in the game. I would need to fire a remote event to the server for a script in the server to play the animation.

I’m just confused because isn’t the player’s character and the dummy, both located on the server side in the workspace and should work the same?

1 Like

local scripts cannot be ran inside of workspace

image

This doesn’t answer the question as to why does the animation work on the character but not on the dummy. They are both at the same location in the workspace.

The LocalScript is inside StarterPlayerScripts, so in the game it is parented to the player’s PlayerScripts.

Basically we have a LocalScript accessing 2 different objects in the workspace, but one works and one doesn’t.

“But when I use the same LocalScript to play an animation on a dummy”
The image in my response isn’t wrong, just take two seconds and reread.

Yes, but try to test it with 2 players. You will see that the dummy’s animation is not replicated to the other players in the game.

do you not know what the client side part is about?

The Solution is Literally in @WolfieCodesMent 's Image, It works on the Players model (model is referring to their Character), The Dummy is not the Player’s Character, nor is it a Player at all, LocalScripts will not run there because of that.

If you want to Run a LocalScript in the workspace:

  • Use a Server Script

  • Change the RunContext to Client

First of “server-side workspace”? Never heard of it. Second, if you want to play an animation on a dummy you’ll have to move that script out of workspace since LocalScripts won’t run in workspace.

Also StarterPlayerScripts will replicate all scripts within it to Players joining the game which is why it won’t replicate to your dummy; the object already exists.

Just change the LocalScript to a ServerScript and change the RunContext to Client and you should be good!

You must’ve missed out on an important class.

They can

Doing this will turn the Script into a LocalScript, but can run basically anywhere.

Yeah they can but it’s not secure. They can just be yoinked.

2 Likes

so can Server Scripts if they arent put somewhere secure.

Yes, that’s also true. But we’re getting off-topic here.

It’s as secure as a LocalScript, if you have any idea of how networking works.

I think I see what you mean. So basically the LocalScript can parented to the player’s PlayerScripts, but it will be able to change any of those 5 items such as the Backpack, Character model, and PlayerGui?

it can only run if its parented to one of those 5 things
so if its not parented to those the script is essentially not there

Yes that’s how I understand it when I look at @WolfieCodesMent image. But my question is how come my LocalScript in the StarterPlayerScripts works on the player’s character but not on the dummy, both of which are inside the workspace. From reading all the comments, it sounded like what they are trying to say is that the LocalScript can be inside any of those 5 items in the image, and it can change the player’s Backpack, Character model, and PlayerGui. Am I understanding them correctly?

Ok so… " It works on the Players model" and this is why the LocalScript is able to play the animation on the player’s character.

But how do you explain it, when I use the same LocalScript to try to change the MeshPart of the character, it does NOT work.

On the other hand… When my LocalScript fires a remote event to the server side and a Script inside the ServerScriptService catches it and changes the MeshPart of the character, everything works fine.

Why isn’t the LocalScript able to change the MeshPart of the character (which is the player’s model)?

because starterplayerscripts is for YOUR player, a dummy is a different thing because it isnt a real player

1 Like