Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How do I create a relative camera for a wall-driving car?

Asked by 5 years ago
Edited 5 years ago

Let's say I have this super rad car that can drive on walls. Problem is, the camera gets all weird and hard to work with when you're driving on a ceiling.

See here: glitchy camera stuff (15.1 MB .gif)

Currently, my solution is to lock the camera completely:

See here: locked camera (20 MB .gif)

However, I'd still like to have the normal camera controls. I've tried modifying the stock camera scripts, but I can't figure them out, there's just way too much weirdness going on with tons of variables changing and going nil and back and whatever, and they use Vector3s anyway, which makes messing with rotation in there really annoying.

I've also tried free models. I've tried search terms from "relative camera" to "rotate camera with player" and it doesn't seem to find anything useful. I remember that Planetary Gravity has a custom camera, but it doesn't work with the car (even if slightly modified to replace the newer camera scripts).

Point is, I can't figure any of this out. The stock camera scripts are too complicated for me, I can't find any pre-made, and fixing the camera in place is a bit too much... Is there a way I could keep the rotation/zooming features of the camera while still allowing it to rotate with the SuperRadCar?

1 answer

Log in to vote
0
Answered by 5 years ago

You have not given any code with could help but what I think you can do is check the cars angle so when is finds that a cars angle is above 25 degrees it would lock the camera like this:

if script.Parent.Orientation >= 25 then
    lock camera script here
end
Ad

Answer this question