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: Rotate to lookVector?

Previous Thread :: Next Thread 
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
26 Jun 2016 06:04 AM
I'm trying to get the bullet to rotate and be parallel to the gun

local GunDirection = Gun.CFrame.lookVector
Bullet.Rotation = GunDirection

The bullet does not change rotation when i change rotation of my character.
Report Abuse
GoogleAnalytics is not online. GoogleAnalytics
Joined: 08 Aug 2008
Total Posts: 455
26 Jun 2016 06:11 AM
Bullet.Rotation = pos * CFrame.Angles(GunDirection) try this.
Report Abuse
GoogleAnalytics is not online. GoogleAnalytics
Joined: 08 Aug 2008
Total Posts: 455
26 Jun 2016 06:12 AM
whooops

.Rotation should be CFrame
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
26 Jun 2016 10:52 AM
bad argument #3 to 'Angles' (number expected, got no value)
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
27 Jun 2016 06:14 AM
bump
Report Abuse
Hedr0n is not online. Hedr0n
Joined: 05 Jan 2016
Total Posts: 1524
27 Jun 2016 06:58 AM
He literally just said it. Bullet.CFrame = CFrame.Angles(Gun.CFrame)
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Jun 2016 07:07 AM
Well actually:

local bullet = bullet;
local bulletPosition = bullet.Position;
local gun = gun;
local gunDirection = gun.CFrame.lookVector;


bullet.CFrame = CFrame.new(bulletPosition, bulletPosition + gunDirection);


Matthew: "Scripting for ROBLOX intelligence? There is no intelligence in ROBLOX." Me: "LOL"
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