Need a camera to automatically tilt
My Hoverboard game “Concrete Jungle” has a camera following the main character, it is rotated and tilted by the right stick, which works fine.
But ideally I would like it to detect if the character is travelling up or down hill and adjust it’s tilt angle to correspond automatically.
Any ideas?
-
How have you done the camera? Using a rig of some kind, perhaps with a motor bolt? If you set the strength to lower while the player isn't trying to change the angle, then it should just natuarlly swing back while the pivot point is pulled forward/up/down.
-
The camera is attached to a cube that follows the puppets head, I use a rotator to turn left and right, and a timeline for the up and down positions as the camera is zoomed in when low and panned out when high.
Thanks that’s a good suggestion for recentering the camera and might use that as well, but I want the camera to alter itself depending on the terrain with no input from the player.
I’ve just made a version using an angle sensor a signal processor to smooth the signal and a timeline with Keyframes of the camera in 3 positions centre, above & below.
It works but it’s still a bit shaky for some reason. So I will have to keep working on it.
I’m not even sure if it’s worth doing or not, but I like to set myself tricky challenges lol :) -
I haven't tested this fully, but I would start by attaching a cube via bolt to the character hips. Put a microchip on the cube with a gyroscope, a laser scope, and a splitter. Set the gyroscope to full strength, and set the laser scope to point straight down (making sure to stretch the arrow far enough that it will hit the ground.
On the third tab of the laser tweak menu, you'll find the "Hit Surface Orientation" output. Wire that output to the splitter, and the C output should change from negative to positive some number depending on the slope your character is on.
From there, there's a few ways to get this to work. I'm guessing you know what to do.
If it's me, I'd use a wireless transmitter to get the signal to the camera. Probably throw a signal manipulator in there somewhere to smooth it out. Then you can keyframe the camera angles, put the keyframes on a timeline, and wire your signal into the playhead of the timeline.
You'll need to either use some calculators or a signal manipulator's threshold remapper to convert the angle range (depends on the slopes in your level) to a range of 0 to 1.
It's currently 1:30 am my time, so it's possible that makes more sense in my head than it does to anyone reading it. lol -
Upon further half-baked testing, it appears you can forgo the block and gyroscope. Just stick the laser inside the puppet chip. As long as you leave that "Local Space" button active (It's on by default), it will give you the accurate slope angle from the C output of that splitter.
-
'@andymationB: Smart idea! You could even point it forward a bit if you wanted to use what's ahead as the angle instead of what's under the puppet's feet.
-
Thanks guys, laser scope is good but it doesn’t tell me if he’s heading down or up hill.
I can get the angle sensor to give me a positive when going up hill and a negative when going down with a range of +90 to -90 but need to figure out how to get that to relate to my timeline with a range of 0 to 1, although ideally it would reach minimum at 60 and max at 60 if that makes sense?
I’ve used calculators and signal manipulators to get somewhere near, but can’t get it exactly in the range I want?
My maths is pretty rusty :) -
The signal manipulator's custom remapper is what you want. You have to select the fourth mode button (It's called "Customer remapper"). Then the scary as *bleep* zig zag window appears. I was initially terrified by this when I first saw it, but it looks more intimidating than it is to set up.
It's really just 4 values that you have to set up. You want to drag the left two values up or down to match the range of whatever "IN" values you're getting from the sensor (e.g. -60 to 60), and then on the "OUT" side, you want to leave that as 0 to 1. I'm sure there are signal manipulator videos on youtube if you want a visual explanation. -
'@AndymationB
Thanks! That’s done the trick!
that makes sense now, I was using the custome mapper but didn’t have it set up right! Doh!
Thanks again for your help, it was really bugging me!
I’ve put it up live now so give it a try and let me know what you think :) -
Adding to what Andy said, there's an extra hidden little time saver in the signal manipulator. If you unpause time, an additional button will appear in the INPUT section of that box. Press it, and it will "learn" the input's min/max range (if it changes over time), so you don't have to adjust them manually.
Little things like this really show the thoughtfulness the Mm devs put into the tools. :)
請登入寫評論。