Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Chase camera

Author
Message
n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 10th Jul 2007 18:06
How would one make a simple chase camera. Such as, when you move an object, the camera follows right behind it?

Ling creckt tsi nocreckto havela? NASA chetallnar mo lu'ul nasding!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 10th Jul 2007 18:40 Edited at: 10th Jul 2007 18:41
You can use the Set Camera To Follow if you dont understand the math behind it.

Otherwise, I know of 3 ways.

1) Use a limb, and position the camera there (I dont like this method)

2) This will keep the camera at the same distance from the player, but will be smooth:


3) This will be smooth, and as the player moves, the camera will "chase" the player:

Didn't test these, but they should work.

n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 10th Jul 2007 18:56 Edited at: 10th Jul 2007 19:45
The third one was close to the model, but it only stayed on one side... I'm making a sort of flight-sim game. I've got the models, and the flying down(mostly ) But now all i need is a camera that'll stay behind the main model, but i'm not sure how. Those last two worked, except the camera only stays looking to one side, and if i try to add enemies, it would be a pain shooting backwards :S.

Ling creckt tsi nocreckto havela? NASA chetallnar mo lu'ul nasding!
Lavitz
19
Years of Service
User Offline
Joined: 16th Jan 2005
Location: Raddix Studio
Posted: 15th Jul 2007 21:05
In that case you'd have to get the camera to also point in the same direction as your model.

DB, the ultimate programming language
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 20th Jul 2007 04:57
Try



Please let me know iif it works.

I keep runing nowhere fast!
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 28th Aug 2007 19:06
Here is some code from the codebase (By Seppuku) that I modified a bit to fit my needs. It's the only code like this I've found that fixes that annoying problem where the camera reverses. (Thanks Seppuku!)

This is what I'm using, I converted it to use an "Up arrow=increase speed, down arrow=decrease speed" system because that's what I'm using:


Here is the original:
http://www.thegamecreators.com/?m=codebase_view&i=b3df8af157bd607a6f7fda4fcd950527


"Of course you should fight fire with fire. You should fight everything with fire!" —Jaya Ballard, task mage

Login to post a reply

Server time is: 2024-09-27 05:16:57
Your offset time is: 2024-09-27 05:16:57