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

How do I SetPrimaryPartCFrame without rotating the model?

Asked by 5 years ago
Edited 5 years ago

When I use SetPrimaryPartCFrame it rotates my model and it faces the left instead of the front even though I only put a position in my CFrame.new.

    jojo=script.Parent.Parent --model
    function apply()
    pos=script.Parent.Value --vector3
    jojo:SetPrimaryPartCFrame(CFrame.new(pos))
    end
    script.Parent.Changed:Connect(apply)

How do I set the position without changing the orientation or how do I set the orientation?

0
You can do CFrame.new(X, Y, Z), which is specfically a position. DeceptiveCaster 3761 — 5y
0
Try using MoveTo instead of SetPrimaryPartCFrame Joshument 110 — 5y
0
@Joshument no DeceptiveCaster 3761 — 5y
0
CFrame is a data type of *Position* and *Orientation* , I personally agree with @MCAndRobloxUnited. Fragmentation123 226 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

The MoveTo object function is better in terms of moving without orientation changes. Since you are working with CFrame, it will require you to change to Vector3 for MoveTo.

0
thanks wwwdanielwww 5 — 5y
Ad

Answer this question