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: Changing a parts Velocity using CFrame*Vector3

Previous Thread :: Next Thread 
edenojack is online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
17 Apr 2015 02:54 PM
I am trying to make the Humanoid Root part, move up and back, depending on the Root's CFrame. But, I'm unsure how to do this with specific regard to the Root part.
So far I have:
Root.Velocity = CFrame.new(-(Dia),Y,Z)*Vector3.new()
(Which is all defined, between 20 and 30)
and simply doing
Root.Velocity = Root.CFrame*CFrame.new(-(Dia),Y,Z)*Vector3.new()
Makes the player fly away at high Y positions.

Is there any way to apply this?
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Apr 2015 03:25 PM
Root.Velocity = Vector3.new(Root.CFrame*CFrame.new(-(Dia),Y,Z))
Report Abuse
edenojack is online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
17 Apr 2015 03:29 PM
Does this make the velocity take on the Root's axis?
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Apr 2015 03:34 PM
Totally did not see that *Vector3.new() at the end
Report Abuse
edenojack is online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
17 Apr 2015 03:49 PM
Just multiplying the two CFrames together makes the HumanoidRoot fly at a redonkulos speed when the player is up high, all I'm after is to send the player in the Roots 'rotatable' X and Z axis. Without the Root.CFrame, its just a regular Vector3
Report Abuse
ThaneTheCreator is not online. ThaneTheCreator
Joined: 08 Apr 2009
Total Posts: 2182
17 Apr 2015 03:55 PM
If you want to send the part in the direction its aiming:
Root.Velocity = Root.CFrame.lookVector * WhateverSpeed
Report Abuse
edenojack is online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
17 Apr 2015 03:56 PM
I'm not just after the lookVector, I'm trying to find the 'LeftVector' and 'RightVector' if you will.
Report Abuse
ThaneTheCreator is not online. ThaneTheCreator
Joined: 08 Apr 2009
Total Posts: 2182
17 Apr 2015 03:58 PM
If you wanna send it flying up:
Root.Velocity = (Root.CFrame * CFrame.Angles(math.rad(90),0,0)).lookVector * WhateverSpeed
The rotation (math.rad(90)) may need to be in the Y or Z axis' but I don't remember.
Report Abuse
edenojack is online. edenojack
Joined: 18 Jul 2008
Total Posts: 989
17 Apr 2015 04:01 PM
OHHHHHHHHH :D
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