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

How To Change A Weld C1 To An Offset Of The Camera?

Asked by
Hibobb 40
9 years ago

Before for animations I created fake arms and welded them to the head. Then I edited the neck weld to follow the mouse so that the fake arms did also. Now I am trying to change that to the arms being anchored and offset from the camera. This way there is no pointless need to change the neck weld.

However I ran into a problem. I already have all the CFrame animating points (for tweening between) made BASED OFF OF THE WELD WITH THE HEAD. I've been trying various ways to recreate the same positions,rotations based on the camera. I've tried using :toWorldSpace() and :toObjectSpace with no success. I am not very good at this kind of math. Here is an example of what I mean:

lArm.C1 = CFrame.new(.1,-1.1,-.9) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(50))--head weld

Turn that into something like:

local default = CFrame.new(cam.CoordinateFrame.p,cam.Focus.p)
        limbs[1].CFrame = default * CFrame.new(0,0,0) * CFrame.Angles(math.pi/2,0,math.rad(50))

Unfortunately the same position values do not work, although the rotation angles do. I do not want to have to go back and redo every single animation.

0
Can you give a screenshot of how the new welds aren't working? I'd like to help but welds are a very visual problem for me. adark 5487 — 9y

Answer this question