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: Barrel

Previous Thread :: Next Thread 
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
28 Jul 2014 08:06 PM
This is a script for the barrel of my tank. Currently, it moves in all directions to point to your mouse. How do I make this script just go up and down to your mouse, so it doesn't point left or right to your mouse.

Vehicle.Turret.Swivel2.Weld.C0 = CFrame.new(Vehicle.Turret.Swivel2.Weld.C0.p, Vehicle.Turret.Swivel2.CFrame:pointToObjectSpace(Vector3.new(Mouse.Hit.p.x, Mouse.Hit.p.y, Mouse.Hit.p.z)))
Report Abuse
MyNameIsPuck is not online. MyNameIsPuck
Joined: 23 Apr 2014
Total Posts: 129
28 Jul 2014 08:09 PM
'up and down' probably means the Y axis, so on the second line maybe you could change the X and Y values of the Vector3 to 0 so the only thing being changed is the Y part.
Report Abuse
MyNameIsPuck is not online. MyNameIsPuck
Joined: 23 Apr 2014
Total Posts: 129
28 Jul 2014 08:10 PM
I meant 'X and Y' not 'X and Y'
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
28 Jul 2014 08:10 PM
You mean "X and Z"?
Report Abuse
MyNameIsPuck is not online. MyNameIsPuck
Joined: 23 Apr 2014
Total Posts: 129
28 Jul 2014 08:13 PM
eh.. jinx?
Report Abuse
MyNameIsPuck is not online. MyNameIsPuck
Joined: 23 Apr 2014
Total Posts: 129
28 Jul 2014 08:14 PM
I just read my first response

I can't type what I think proper. Derp.
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
28 Jul 2014 08:19 PM
Vehicle.Turret.Swivel2.Weld.C0 = CFrame.new(Vehicle.Turret.Swivel2.Weld.C0.p, Vehicle.Turret.Swivel2.CFrame:pointToObjectSpace(Vector3.new(Vehicle.Turret.Swivel2.Position.x, Mouse.Hit.p.y, Vehicle.Turret.Swivel2.Position.z)))

Changed it to that, but it doesn't really point your mouse unless it's in the extreme areas, for some reason. (i.e your mouse is way up there, or way down there)
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
28 Jul 2014 08:25 PM
bump
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
28 Jul 2014 09:02 PM
bump[2]
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