generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Angles, how do they work, am I right?

Previous Thread :: Next Thread 
Arrenias is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image