Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I Cant make a Robloxian face one direction all the time any ideas?

I'm new to scripting and i use RobloxWIKI as my recourse for scripts, I cannot seem to find how to do as the title says, i can turn off the players animation but that's as far as i've got any ideas or links to help me?...

1 comment

0

Are you trying to make the whole character face a certain direction?

1 answer

To disable turning (like when you push a WASD key) there's a humanoid property named 'AutoRotate.' With that off your character will permanently face the direction it was while the property was true. After that, you can script the character's direction.

A script inside the character model:

character = script.Parent
character.humanoid.AutoRotate = false
HRP = character.HumanoidRootPart --I use HumanoidRootPart because this is the only good reference part now that animations can move your torso as well.

y = math.rad(90) --Put in an angle in degrees here and it'll rotate your character along the Y axis
HRP.CFrame = CFrame.new(HRP.Position.X, HRP.PositionY, HRP.Position.Z)*CFrame.Angles(0,y,0)  --Takes the original Position and rotates the part y radians along the Y axis.

Are you making a 2D based game? I can see how this'll be useful for that, good luck!

EDIT: My original script never actually rotated anything... Fixed now!

This discussion is preserved as it was. New answers, comments, and votes are closed.