x


Camera position on path Proportional to Player'sposition

HI!

I'm a newbie here. Please forgive my bad english, i'm a french student^^.

Well, i have a problem with my camera in unity. I have a camera on an itweenPath (a catmull rom spline). I want to move it when the player is moving (the best exemple is God of war camera).

But it can't work if i d'ont put my character on a waypoint path. This is my first (of many ^^) question.

How can i assign a waypoint path to my Player but don't force it to follow the path?

My second question:

When i'll have my two path i want to calculate avery frame where my camera is (in percent) on the itweenPath when the player is at 50% of the waypointPath.

To do this, i've read that i have to use polynomial interpolation, to interpolate values constantly from waypoints to spline points. For exemple

Player position% = Camera position %

0 10

20 10

40 20

60 40

et ainsi de suite.

I've read on a http://gamedev.net tread that i have to use Lagrange method.

But i don't know how to script it.

Anyone can help me to do this? I've read many post and website on waypoint and Lagrange interpolation. But it didn't helped me :/

I know that it is possible but it will kill me^^.

Thanks for reading this :). Have Good Day!

more ▼

asked Nov 16 '11 at 12:48 AM

Alenros gravatar image

Alenros
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2987
x237
x170
x12

asked: Nov 16 '11 at 12:48 AM

Seen: 713 times

Last Updated: Nov 16 '11 at 12:48 AM