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

How can I get a CFrame relative to a position and rotation?

I'm trying to consistently place my player exactly 1.65 studs above a brick, but my method doesn't incorporate rotation. It doesn't break, but I want it to seem like the player is sitting on the brick.

--rootPart is the HumanoidRootPart
--seat is the seat the player is sitting on
rootPart.CFrame=seat.CFrame+Vector3.new(0,1.65,0)

I'm really not sure how to approach this, any help would be appreciated!

1 answer

✓ Accepted answer
rootPart.CFrame = seat.CFrame * CFrame.new(0, 1.65, 0)

All you gotta remember is that you add vectors, but multiply CFrames.

3 comments

1

Here's a good link to explain more about this by BlueTaslem. https://scriptinghelpers.org/questions/37400/a-short-cframe-question-can-someone-explain-this

0

Thanks @OldPalHappy, I was looking for it.

0

Thanks so much! I've been puzzling over this for years!

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