how to move a Dummy in roblox

Viewed 181

I have been trying to make a Dummy move in roblox studio, but I have no idea how to do it and everything I've tried does not make it move at all, I have tried vecter3.new and stuff with position and primaryPart but nothing works. If anyone knows please tell me.

the script:

local dummy = game.Workspace.Dummy.Humanoid
local flag = game.Workspace.USAnimatedFlag
dummy:MoveTo(dummy.)
1 Answers

You have set the variable dummy to the Humanoid contained within the model, but the Humanoid is for storing character stats (health, etc.). It doesn't have a :MoveTo() method because the Humanoid doesn't represent the dummy model's physical state in the world - the model itself does.

This code assumes you want to move the dummy to the flag, and that the flag is also a model:

local dummy = game.Workspace.Dummy
local flag = game.workspace.USAnimatedFlag
dummy:MoveTo(flag.PrimaryPart.Position)

https://developer.roblox.com/en-us/api-reference/function/Model/MoveTo

https://developer.roblox.com/en-us/api-reference/property/Model/PrimaryPart

https://developer.roblox.com/en-us/api-reference/class/Humanoid

Related