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

How can I make a script that is always making calculated positions?

Asked by 7 years ago

I am trying to make a piston. I'm using BodyPosition

PartA is facing 0 deg Its position is 0,0,0 PartA is clicked and PartB is moved 0,0,5 (Facing Same Direction as partA)

PartA then changes its facing to 90 deg Its Position is still 0,0,0 PartB automatically goes to 5,0,0 (Facing Same Direction as partA)

PartA is clicked, PartB goes to 10,0,0 (Facing Same Direction as partA)

PartA changes facing to 45 deg PartB goes to 7.07106781187 , 0 , 7.07106781187 (Facing Same Direction as partA) And PartB still is 10 studs away from PartA

I need a script that makes PartB still stay within a range of PartA, while PartA can be moved by a push of a button constantly.

Sorry if this is hard to understand

Answer this question