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 / sparky problem

Author
Message
aw1231
13
Years of Service
User Offline
Joined: 13th Mar 2011
Location:
Posted: 1st Apr 2011 00:01
I have setup sparky's, and I have collision on, however my camera can still go through, how do I fix that?
Dodga
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 1st Apr 2011 01:49
It's not automatic, the best thing to do would be to post your source code and we can help you with that, also look at the sample file in the sparky's dir for more info. Theres more to it than just adding objects and then expecting everything to work. What you have to do is position a sphere at the camera's location, then check every cycle to see if the sphere collides with anything, then if the sphere collides, stop the camera from moving any farther in that direction.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 1st Apr 2011 21:34
As Dodga says, using a sphere for your cameras position.

I generally use:

collide=SC_ShereCastGroup()

the radius of the sphere is the size of the area needed.

You will also need the start x,y,z position and the ending x,y,z position, no need to move your camera until you're done.

A little bonus of the SphereCast is that you can retrieve the sliding values to which you can move you're camera position to.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-06-15 21:33:21
Your offset time is: 2024-06-15 21:33:21