My tank goes haywire when I attach my turret to it?
Asked by
7 years ago Edited 7 years ago
So I have a turret that would always point at the player's mouse. I want to attach it to a car, but whenever I attach it together using Hinge, I test, the car and the turret would go flying crazy and look very glitchy. My goal is to attach the turret onto a car, without making it go haywire of course. Anyone know a solution to this? Thanks!
This is the script that makes the turret follow the player's mouse.
01 | game.Players.PlayerAdded:connect( function (p) |
02 | p.CharacterAdded:connect( function () |
03 | repeat wait() until game.Workspace.TestingCannon.SpinningPart.Base |
06 | local m = p:GetMouse() |
10 | local base = game.Workspace.TestingCannon.SpinningPart:WaitForChild( "Base" ) |
11 | local h = p.Character:WaitForChild( "Head" ) |
12 | base.CFrame = CFrame.new(base.Position,Vector 3. new(t.X,t.Y,t.Z)) |
Base is basically the turret.
Sorry if this has nothing to do with scripting.