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/Object follow problem

Author
Message
Cpt Skydiver
17
Years of Service
User Offline
Joined: 23rd Mar 2007
Location: Behind my computer?!
Posted: 2nd Mar 2008 17:51
Im fairly new to dark GDK and i ran into a problem with my camera following an object (in this case a cube).
I wrote a code to move the cube with wasd (like in an fps) and look around with the mouse(the cube itself doesnt *look* up only the cam). Then i made the camera follow the cube but... here comes my problem:

it wont let me look left/right because the camera/cube tries to turn to the left/right but the cam has to center itself on the cube and it blocks itself that way so i cant look left/right.... it doesnt help with removing one of the lines which turns the cube/camera

hope somebody can help me out

heres the code:
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 2nd Mar 2008 18:24
Just as in the real world I would recommend
1/. Hiding the cube

2/. Backing away from the cube

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
Cpt Skydiver
17
Years of Service
User Offline
Joined: 23rd Mar 2007
Location: Behind my computer?!
Posted: 2nd Mar 2008 18:37
1 hiding the cube doesnt solve my problem

2 what do you mean?
in the end it wont be a cube but a model of a player
ogourietz
16
Years of Service
User Offline
Joined: 29th Feb 2008
Location:
Posted: 2nd Mar 2008 18:59
I've written the exact same kind of code today, it works, the only difference is that don't use the "dbSetCameraToFollow" function.
Here's the code just in case it could help :
Cpt Skydiver
17
Years of Service
User Offline
Joined: 23rd Mar 2007
Location: Behind my computer?!
Posted: 2nd Mar 2008 20:00
thanks alot ogourietz

with a little modifying that did the trick for me too

Login to post a reply

Server time is: 2024-09-29 13:36:47
Your offset time is: 2024-09-29 13:36:47