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

CFraming an object at the Hit.Position?

I have a part that on touched will weld a player where they hit it from, while simulating them hanging onto the part.

All of the positions are defined on touch like so,

local HitPos, RimPos, RootPos = Hit.Position, Rim.Position, Root.Position

I've currently tried it this way:

Root.CFrame = CFrame.new(HitPos, RimPos)

I also experimented with Offsets and such but regardless the player never seems to be welded how I would like them to in reference to where they touched the part as they seem to be floating in the air nowhere near the part like so:

https://i.gyazo.com/87b6a8275050fc70d057c9d691761373.png

Would RayCasting be better for something like this or am I just missing something with how I'm doing the CFrame?

1 answer

Change Position to:

local HitPos, RimPos, RootPos = Hit.CFrame, Rim.CFrame, Root.CFrame

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