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 » Scripting Helpers
Home Search
 

Re: lookVector help

Previous Thread :: Next Thread 
snowboarder199 is not online. snowboarder199
Joined: 15 Aug 2009
Total Posts: 2703
26 Jun 2013 02:22 PM
so when im using a keydown weapon right now and one of the attacks im making requires me to set my torso's lookvector to where my mouse is pointing, can someone help me with this?

like....


game.Workspace.snowboarder199.Torso.CFrame.lookVector = mouse.Hit.p

i dont think thats quite all of it though :/


(i already have all the keydown and mouse functions setup im just looking for how to set the lookVector)
Report Abuse
jrf2112 is not online. jrf2112
Joined: 29 Jun 2008
Total Posts: 3354
26 Jun 2013 02:24 PM
game.Workspace.snowboarder199.Torso.CFrame = CFrame.new(game.Workspace.snowboarder199.Torso.Position, mouse.Hit.p)

This should work.
Report Abuse
BJJScrambler is not online. BJJScrambler
Joined: 13 Jan 2013
Total Posts: 898
26 Jun 2013 02:24 PM
CFrame.new(position,point)

returns a CFrame at 'position' facing 'point'

so like this:

game.Workspace.snowboarder199.Torso.CFrame=CFrame.new(game.Workspace.snowboarder199.Torso.CFrame.p,mouse.Hit.p)
Report Abuse
snowboarder199 is not online. snowboarder199
Joined: 15 Aug 2009
Total Posts: 2703
26 Jun 2013 02:27 PM
you guys rock, thanks so much :D
Report Abuse
jrf2112 is not online. jrf2112
Joined: 29 Jun 2008
Total Posts: 3354
26 Jun 2013 02:31 PM
Yes. Yes we do.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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