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

How do you set a bodygro to a part's position?

Asked by 10 years ago

I want a bodygyro to keep a part straight. How do I make it look where the part is currently looking? It doesn't have a position property or anything like the bodyposition.

1 answer

Log in to vote
3
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

Look at the Wiki article or the Object Browser for that matter.

It does have a .cframe property which is the "The rotation goal of the object".

The Properties tab never lists CFrame properties, which is why it's not listed there.


A part's current CFrame is simply part.CFrame, so to set its BodyGyro to keep it in the same orientation, you could use

part.BodyGyro.cframe = part.CFrame
-- Note the case of `cframe` and `CFrame`.
0
@Blue; do you know who it could be suggested to to have an option to display CFrame values in Properties? adark 5487 — 10y
0
I don't know who deals with that, you could try asking on the #roblox IRC on freenode and someone there might be able to answer. BlueTaslem 18071 — 10y
0
Another reason why i shouldn't script at 3am Maxwell_Edison 105 — 10y
Ad

Answer this question