Camera Follow Custom

ok what i want to do is really complex… and im new… well its complex cause i dont know how to do it hehe… so here it goes -

What I Have - Bike and Road (With Walls)(Mesh)

What i Want to Do -

  1. The Camera must follow a ‘SPECIFIC’ portion/path of the ‘ROAD’…

  2. But, It has to be behind the bike a certain distance at all times…

Explaining a little more clearly - the camera has to follow the bike as it accelerates, but its focus should be on the road, ie, the camera FOLLOWS the BIKE, but TURNS / change angles with the ROAD…

How am i supposed to do that??

I LV U ALL :):):):):slight_smile:

Make the camera follow the bike but interpolate the rotation based on the roads spline.

Didn’t make the road with a spline? Create a path script with spots you can place around the road rotate the points and keep the rotation based on the rotation between the 2 points. The last can be issued for AI target points too.

It is a bit complex lol

@ the road is a mesh…

  1. What is interpolate?? and how do i do that??

  2. i didnt understand those ‘points’ u want me to place… what are those?? and how do i place them??

im newbie… plz help me :):slight_smile:

I LV U :):wink:

Whatch this:

Use this to keep between rotation:

And this but rotate the points to face the direction of the road so you can keep the rotation:

This is all just theoretical you will have to do the implementation maybe someone on here has done something like this before? Incase people don’t get what you want, Ever seen Mario 64 on n64? They have a camera that follows Mario but if you get to a cornor the camera auto rotates to show the path

@ Thank You So Much !! ;):wink:

No i havent played mario but i saw something like this in Road Rash, and im trying to make a game like that :):slight_smile: So Thank You !!!

ah, okay i just looked up road rash i haven’t heard of it you see ha. yeah the camera is simply moving along a spline, watch the video to learn how to make bezier curves and just make one for the camera to fly through. The rotation can match the tangent line of the curve, it might be worth getting a math book such as:

that book is pretty hard core though but if you go at it you will do it :slight_smile:

This could be useful for implementation if you just want to do code and not bother with math:

That would be the modern implementation in a full polygonal engine (basically unity 3D rather than unity 2D) because road rash is fake 3D.

http://www.extentofthejam.com/pseudo/