#Need help knowing how to make it so camera is enabled when they sit in DriveSeat.
1 messages · Page 1 of 1 (latest)
to have the camera change as soon as you sit, you could connect the touched event of the car. you do have to also check that whatever touches it is a player though:
car.DriveSeat.Touched:connect(function(OtherPart)
Assembly = OtherPart.AssemblyRootPart.parent --for a player that resolves to the character model
if Assembly == plr.character then
if not debounce then
debounce = true
enableCam()
end
end)
--note: when you disable the camera, you should also set the debounce back to false.
--you can't do it in the if statement because other wise you risk enabling the camera multiple times.
car.DriveSeat.ChildRemoved:connect(function(obj)
if obj.Name == "SeatWeld" then
disableCam()
if debounce then debounce = false end
end
end)
Hope this helps!
hey, im sorry bro but i have NO idea where to put any of this script, sorry i am confused can you help me put the script together?
the code i submitted just now will replace the last two lines of the original code - delete these:
car.DriveSeat.ChildRemoved:connect(function(obj)
if obj.Name == "SeatWeld" then disableCam() end
end)
UserInputService.InputBegan:Connect(handleInput)
and add the code i submitted
** You are now Level 1! **
sorry i still dont know, can you update the full script for me? i can give u some robux
sorry im really bad at scripting
it's fine, we all start somewhere. ill be taking the robux though. can we do 100?
it shows up underlined in red.
it still doesnt work for some reason
any errors?
nope
but the camera wont change, right?
yep it doesnt change
new day, more time to troubleshoot.
ill get back to you in (hopefully) less than an hour.
ok, so i have something.
so turns out, the way the script is set up, the player will have sat before anything in the script can listen for the player entering. your best bet to having the camera work immediately would be to explicitly enable the debounce and call enableCam().