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

How too keep a block in the same location when rotated?

Asked by 9 years ago

So basically I understand that CFrame keeps 2 parts moving together. However, I have two blocks. I want the blocks to stick to eachother but allowing the top one to move. The pole/stick moves where I point my mouse, but how can It stay in the same location if I move the bottom part in the game? I already defined some of the variable already above such as (look)

http://prntscr.com/703rrm

local Pos = CFrame.new(script.Parent.Parent.CFrame.p,(look).p) * CFrame.Angles(0,math.rad(-90),0)
    script.Parent.CFrame = Pos

So basically the pole moves where I am pointing my mouse, but if you move the bottom block, it slides out and the stick falls. I don't want this to happen. Would I have to use a motor weld or something?

1 answer

Log in to vote
0
Answered by 9 years ago

Just make sure everything is welded (I'd suggest a weld plugin on the roblox website)that should make sure that when you move the bottom block the pole moves too.

0
But the problem is that if I weld the blocks together, they will move in the same direction my mouse points..For example lets say I have 2 poles stuck together. I want the bottom pole to move a different direction and the top pole to move another direct, but being able to have them stay connected together on the same Y axis. I understand motors are able to do this but I don't know if that's what I TimeTicks -2 — 9y
0
Well all i can tell you then is to just experiment with motors, and welds to see which one helps suit your need. alberthutchins 12 — 9y
Ad

Answer this question