Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 07 Nov 2009 06:16 PM |
| I want to make the Humanoid rotate exactly 35 degrees. I thought of using Humanoid.WalkDirection, but I forgot how to use it. I feel so stupid. |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2009 06:18 PM |
WalkDirection isnt a function Use something like
torso.CFrame = torso.CFrame * CFrame.fromEulerAnglesXYZ(0, math.deg(35), 0)
I forgot what turns degrees into radians :-P |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 07 Nov 2009 06:19 PM |
xLEGOx said it was valid >_>
I was thinking of using fromEulerAnglesXYZ, but it wouldn't be a gradual turn would it? |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2009 06:23 PM |
for x=1, 35 do (that script, only by 1 degree each time) end
idk how to use for commands very well |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 07 Nov 2009 06:24 PM |
Well...
You could do that, but I was trying to do it a different way >_> |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2009 06:27 PM |
| Is it for a cutscene or just to mess with the player when they touch a brick? |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 07 Nov 2009 06:28 PM |
| Not a cutscene. Artifical Intelligence purposes. |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2009 06:39 PM |
Ah... If it were a cutscene you could use an anchored brick under the character, and a motor object... You could probably use that with AI, but it would look wierd... |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 08 Nov 2009 08:42 AM |
Bump.
So.... How do I do it with WalkDirection? |
|
|
| Report Abuse |
|
|
gombob
|
  |
| Joined: 01 May 2008 |
| Total Posts: 5215 |
|
|
| 08 Nov 2009 08:46 AM |
You can't. You'll have to do it with a CFrame
x.CFrame = x.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(35), 0)
I think it's math.rad()... |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 08 Nov 2009 08:48 AM |
| You CAN! Fine, without the help of the community I'll do it myself. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2009 08:49 AM |
| WalkDirection is a property. I think it's in CFrame. |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 08 Nov 2009 08:55 AM |
| WalkDirection is a property of Humanoid. |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 05:52 PM |
Sadly WalkDirection, apparently is "Non-Scriptable", what that means, IDK,
But what I Do know though is that there's an easyer way to do this With the BodyGyro object, Now you want it in degrees, right? The object works in units of radians, but there is a scripting term that auto converts the degreese in radians:
turn = Instance.new("BodyGyro") turn.Parent = (torso here) turn.cframe = CFrame.new() * CFrame.Angles(0, math.rad(35), 0) turn.maxTorque = Vector3.new( 40000, 40000, 40000) wait(2) turn:Remove()
thats it and make sure u spell cframe the way i spelled it the way my caps are i know its wierd that 1 has CF and 1 has cf, but its how its spelled got a problem with that, then complain to Roblox's non-respawnsive answering machein, not my problem, not my fault
i dount u need this any more since the last update was years ago, but still hope this helps
|
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 17 May 2013 05:53 PM |
| Thank you for bumping this 2009 thread. |
|
|
| Report Abuse |
|
|