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.

DarkBASIC Professional Discussion / Camera following player goes through walls

Author
Message
DirkVW
22
Years of Service
User Offline
Joined: 14th Mar 2003
Location: United States
Posted: 15th Mar 2003 06:01
I have the camera following my player (using SET CAMERA TO FOLLOW) through a 3D level, but the camera goes through walls whenever the player turns corners, goes up/down, or some other movement that requires the camera to follow the player "through" a wall. I want the camera to "collide" with the walls so it doesn't go through them, but i'm not sure how to do this. Can I use "AUTOMATIC CAMERA COLLISION"? I tried that and it doesn't work, even though my actual object collision routine works fine.

I hope this is enough information
qacoolguy
22
Years of Service
User Offline
Joined: 14th Mar 2003
Location: Cyberspace
Posted: 15th Mar 2003 06:21
A possible solution is to set the collision field (the last variable) to 1 for static collision. If this doesn't work, then you could always position an object on the camera and hide it. When the object hits a wall, you could decrease the distance value to move the camera away from the wall. When the object on the camera is not colliding with a wall, you could increase the distance value back to its original number. Hope this helps!

DirkVW
22
Years of Service
User Offline
Joined: 14th Mar 2003
Location: United States
Posted: 15th Mar 2003 06:29
That's a great suggestion, thanks

Login to post a reply

Server time is: 2025-05-18 23:06:49
Your offset time is: 2025-05-18 23:06:49