How to create a bobbing camera while walking?
Blitz3D Forums/Blitz3D Beginners Area/How to create a bobbing camera while walking?
| ||
New question, sorry lol. I thought it would be neat if my camera was a little bit more realistic in my game. Is there a way I could make it bob up and down while it's moving? |
| ||
I already saw something like this months ago. You can try searching in the archives or do a forum search, I'm sure there is one. One option that would make this work is by attaching a pivot to your main/player camera. |
| ||
i see 2 ways to achieve this : -one would be to use maths to position the camera related to a pivot (there is an example of this somewhere) here : http://www.blitzbasic.com/codearcs/codearcs.php?code=1516 -one would be to create a skeleton with joints/bones, and a walk/run animation with an exaggerated motion and then position oriente the camera at the same position orientation than the "eyes" joint/bone (i have made an example of this in code the past, i will see if i can find it) |
| ||
Use a sine curve and translate the camera through its local vertical axis by a sinusoidal amount each frame that the camera moves forwards or backwards. |