Arrenias
|
  |
| Joined: 24 Dec 2008 |
| Total Posts: 45 |
|
|
| 13 Aug 2016 06:00 PM |
It says this forum isn't for help scripting, but there is no forum for help with that. There are few resources, and I can't for the life of me figure out why this will not work.
character.Torso.Velocity = Vector3.new(math.sin(character.Torso.Rotation.Y) * 100,0,0)
Essentially I'm trying to get the character to be moved to the right based on their rotation. Thus trying to use sine to alter the force of the push so that I could use two values to push them on world X and Z in such a way to mimic them moving along the local Z.
How roblox's character angles work is that at North and South, the Y value is 0. And at East and West it is +90 and -90 respectively. (May be incorrect on the directionals, but it paints a clear enough picture) So one would assume by using Sine, you would get near a value of 1 facing east and west, and a value of 0 facing north and south, and the force applied would slope smoothly between.
How it is working in practice, is that if the character is facing say, north east...it acts as though they are facing southwest...but when facing northwest, it's as though they are facing straight east. If anyone has a clue as to why this is, or if I'm missing something integral, please educate me. |
|
|
| Report Abuse |
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 13 Aug 2016 07:14 PM |
You're overthinking it. Simple do:
Torso.Velocity = Torso.CFrame:vectorToWorldSpace( Vector3.new(100,0,0) ) |
|
|
| Report Abuse |
|
Arrenias
|
  |
| Joined: 24 Dec 2008 |
| Total Posts: 45 |
|
|
| 13 Aug 2016 07:20 PM |
| Ah, so there is some sort of toworld command. Thank you very much! |
|
|
| Report Abuse |
|