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

How to make Mouse.Hit Determine BodyGyro X,Z Rotation, not Y?

Asked by 8 years ago

So like the question says, I'm trying to get BodyGyro to only rotate in the X and Z axis in the direction of mouse.hit. Right now I have a loop that rotates my "engine" (Just a part) on the y axis. This line of code appears in a loop while "D" is held down on the keyboard:

engine.BodyGyro.cframe = engine.CFrame*CFrame.Angles(0,-.3,0)

I have one for the opposite direction when A is held. Then I have another line of code while I'm holding my mouse button 1 down:

engine.BodyGyro.cframe = mouse.Hit

How would I have mouse.Hit's X,Z rotational cords affect BodyGyro's cframe in the X,Z direction?

0
Bump. snowbee15364 0 — 8y

Answer this question