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: Make a part look at the direction of its Velocity?

Previous Thread :: Next Thread 
Graidlyz is not online. Graidlyz
Joined: 25 Dec 2011
Total Posts: 13357
16 Feb 2016 08:04 AM
Can't figure out how.




Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
16 Feb 2016 08:06 AM
Maybe use a BodyGyro to look at the same point:

http://wiki.roblox.com/index.php?title=API:Class/BodyGyro


Report Abuse
Graidlyz is not online. Graidlyz
Joined: 25 Dec 2011
Total Posts: 13357
16 Feb 2016 08:07 AM
I know I need to use BodyGyros, what I can't do is the "math" or whatever it is


Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
16 Feb 2016 08:10 AM
It's pretty simple, the BodyGyro looks at the rotation property of its CFrame(It ignores the position property).

BodyGyro.CFrame = CFrame.new(Vector3.new(0, 0, 0), mouse.Hit.p)) --this would make it look at the position of your mouse, change mouse.Hit.p to where the velocity is aiming at




Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
16 Feb 2016 08:13 AM
Try

part.CFrame = CFrame.new(part.Position, (part.Position + part.Velocity))
Report Abuse
Graidlyz is not online. Graidlyz
Joined: 25 Dec 2011
Total Posts: 13357
16 Feb 2016 08:32 AM
"the velocity is aiming at"

the velocity direction is a unit vector

mouse.Hit.p is a position

@128

doesn't work


Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
16 Feb 2016 09:56 PM
It does work I just tested it.
Report Abuse
Graidlyz is not online. Graidlyz
Joined: 25 Dec 2011
Total Posts: 13357
17 Feb 2016 04:05 AM
Works, I did something wrong, ty.


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