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

How can I lock a character to always be the same orientation as a given part?

Asked by 5 years ago
Edited 5 years ago

This question may be a bit odd.

I am currently working on a zero gravity space game and have found a way to make gravity in selected areas (like stations and ships) by putting a BodyForce in the player's torso that activates when the player's character enters the ship or station. This method has worked great so far but a problem arises when the ship/station's floor is oriented at any angle besides 90 degrees on the y axis. The way I designed the script makes the player always go down relative to the workspace (-y) and allows them to walk on the ceiling of the ship if it is upside down.

Are their any good methods to keep the player oriented with a given part? and if so, can a have a BodyForce change the gravity so the that part is the gravitational "floor"?

Please ask me to clarify if you don't fully understand something in my question.

EDIT 1: Here is an Imgur album that should clear up what I am trying to do.

0
So you're saying if the floor is slanted a bit... then what happens? Pojoto 329 — 5y
0
the BodyForce is trying to emulate gravity by constantly dragging the player's torso downward. This only works if the floor is not slanted, otherwise the player is climbing a slope XXXlawsonXXX 52 — 5y

Answer this question