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 Collision Boundaries.

Author
Message
Flux
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location:
Posted: 26th Feb 2010 20:55
I've been using the automatic camera collision for my fps however I'm running into problems. When I want to collide with high or low objects I'm moving straight over or under them.

What I've been trying to do is to create a box just behind the camera that is locked in relation to the camera so that when I walk towards a low object the box collides with it. This is not working for quite a few reasons. I believed by using a box around the player it would mean that I could also use it to detect bullet hits. I know how to fix this problem if I alter the collision sphere of the camera but this would also alter how far away I collide with walls which is not what I want.

Anybody got any ideas about how I may be able to get around this problem. I'm guessing it's a common problem.

Thanks!
Carlos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 27th Feb 2010 04:58
I suggest to use Spark's SC_Collision plugin.
Use sphere cast to test collision in the moving direction before moving the camera.
Flux
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location:
Posted: 27th Feb 2010 23:33
Thanks Carlos. I have went away and have started using SC_Collision and it seems really good but also quite complicated especially when trying to apply it to the camera. Luckily I found



Here's the link...

http://forum.thegamecreators.com/?m=forum_view&t=156481&b=22

I seem to be getting a problem though. I can't move when as if I'm stuck in the floor. I tried adjusting the collision radius but have had no luck so far. Any ideas. This SC collision system is proving really difficult. I'm finding the documentation particularly poor for Dark GDK in general which is a shame.
Flux
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location:
Posted: 28th Feb 2010 11:29
I got it working now. It was a case of fiddling and fiddling until it worked I think. I've integrated it into my code so hopefully I'll be able to detect low and high objects much more easily now. I'll post when I have tried it.
Flux
14
Years of Service
User Offline
Joined: 19th Feb 2010
Location:
Posted: 28th Feb 2010 15:09
I still can't get the camera to collide with the object. when I show the objects bounds they are tiny and below the object. I have tried using update object but it's not helping.





I hope the code has copied properly. I can't check it and edit it because my posts have to be approved.

Login to post a reply

Server time is: 2024-10-05 16:27:47
Your offset time is: 2024-10-05 16:27:47