Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

2 comments

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

0

Well all i can tell you then is to just experiment with motors, and welds to see which one helps suit your need.

This discussion is preserved as it was. New answers, comments, and votes are closed.