|
| 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 |
|
|
|
| 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 |
|
|
|
| 28 Jul 2014 08:10 PM |
| I meant 'X and Y' not 'X and Y' |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 28 Jul 2014 08:14 PM |
I just read my first response
I can't type what I think proper. Derp. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
| |
|