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

CFraming an object at the Hit.Position?

Asked by 2 years ago

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

Log in to vote
0
Answered by
SuperPuiu 497 Moderation Voter
2 years ago

Change Position to:

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

Answer this question