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

How to change position of a part according to current position?

Asked by
sheepposu 561 Moderation Voter
5 years ago

I am making a weight lifting item and I need to move the weight in a a specific motion. The problem is I don't know how to code it. I was think

script.Parent.Position = script.Parent.Position + --Don't know what to put here

1 answer

Log in to vote
1
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

Positions require Vector3 values. To change your Position relative to it's previous, maintain the current format used, and implement the Vector3.new() function near your addition operator

local Part = script.Parent
Part.Position = (Part.Position + Vector3.new(x,y,z))
Ad

Answer this question