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.

Dark GDK / Camera Follow

Author
Message
Air0x
14
Years of Service
User Offline
Joined: 26th Oct 2010
Location: C#, C++, Java, VB.NET, QBASICA
Posted: 28th Oct 2010 23:50
Hey again
I working on my RPG as I said before...
Is it possible to make the camera follow the character?
Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 29th Oct 2010 05:42
You can use dbSetCameraToFollow();

Air0x
14
Years of Service
User Offline
Joined: 26th Oct 2010
Location: C#, C++, Java, VB.NET, QBASICA
Posted: 29th Oct 2010 12:08
Ok thank you
Air0x
14
Years of Service
User Offline
Joined: 26th Oct 2010
Location: C#, C++, Java, VB.NET, QBASICA
Posted: 29th Oct 2010 13:43
Didnt work I make a cube with size 100 and id 3 then I use:

dbSetCameraToFollow(3,3,3,3,3,3,3,3);
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 29th Oct 2010 18:00 Edited at: 29th Oct 2010 18:06
Your camera is inside the cube with those parameters. You won't see the cube.

EDIT:
try this:

You will need to make some globals:


The fastest code is the code never written.
Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 29th Oct 2010 18:10
The usage for dbSetCameraToFollow is (X, Y, Z, Angle, Distance, Height, Smoothing, Collison); just passing the objects id to all the paramenters is not going to work.

Your basicly telling it to track a point in 3d space and not anything in particular. To track your cube the first 4 would be dbObjectPositionX(3), dbObjectPositionY(3), dbObjectPositionZ(3), dbObjectAngleY(3). Then distance would be how far away from the point you want the camera to remain, height is pretty much the same, how high up from the point. Smoothing is a value 1-100, and collision will make sure the camera takes into acount collison.

All this information is in the GDK Help file and is very useful for finding out how to use the commands or even for just finding a command you don't know anything about.

Login to post a reply

Server time is: 2024-11-19 16:30:58
Your offset time is: 2024-11-19 16:30:58