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

How do i make a Vector3 that works move the brick that the script is a child of?

Asked by
KelcriC -1
6 years ago

This is my code that doesn't work, but it looks fine

    script.Parent.MouseClick:Connect(function(player)

    player.leaderstats.Power.Value = player.leaderstats.Power.Value + 1
        local model = script.Parent.Parent
        local endPosition = Vector3.new(-81.58, -73.922, -477.425) 



          wait(3)
                model:MoveTo(endPosition)
    end
)

The leaderboard part works, but not the Vector3. This script is in a clickdetector that the brck is the parent of.

1 answer

Log in to vote
0
Answered by
0RKH 35
6 years ago

You could do

part:MoveTo(endPosition)

and delete line 4.

When you said “brck” I assume you refer to that as a part, right? Well, in your script it’s a model so we could just change model to part as seen above.

0
The MoveTo() method is only for models, not parts green271 635 — 6y
Ad

Answer this question