Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isnt my script moving the entire dummy?

Asked by 3 years ago

Ok so in my game i have a script that moves a monster when the game starts which is currently just a dummy. But when i tell my script to move the HumanoidRootPart it only moves the actual HumanoidRootPart and not the entire body as it should. Does anyone know why this is?

There is no error's in the console.

ServerScript that moves the dummy

01wait(1)
02local map = workspace.Map.Value
03local Map = workspace:FindFirstChild(map)
04 
05if not Map then
06    print("could not find requested map : ".. map)
07end
08 
09local MonsterSpawn = Map:WaitForChild("monsterSpawn"):GetChildren() -- gets all the possible spawnlocations
10local randomMonsterSpawn = MonsterSpawn[math.random(1, #MonsterSpawn)] -- Chooses a random spawnlocation
11local Monster = game.ServerStorage.grandiosav5
12 
13Monster.Parent = workspace
14Monster.HumanoidRootPart.Position = randomMonsterSpawn.Position -- moves the monster (issue is located here)
0
thats the whole code? Xyternal 247 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

If you want to move an entire model you have to use :MoveTo(). Here is the Roblox Api Reference to it: https://developer.roblox.com/en-us/api-reference/function/Model/MoveTo

For example, in your case it would be:

1Monster:MoveTo(randomMonsterSpawn.Position)

Hope this helps.

0
This worked thank you <3 grandiosav4 62 — 3y
Ad
Log in to vote
0
Answered by
Xyternal 247 Moderation Voter
3 years ago

Have you tried using path Finding services before? If I am correct, then you can use path Finding services to get to your desired location

Answer this question