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 Discussion / help with my collision coding

Author
Message
stann65
21
Years of Service
User Offline
Joined: 3rd Feb 2004
Location: england
Posted: 11th Apr 2004 19:08
hi all,
what i want my game to do is when the gun which is locked in object 1 has collision with something (in this case a cube) the camera can not go any further because of collision. At the moment when it collides it is hesistant for a second and then lets through please help me fix the code.


TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 11th Apr 2004 20:20
I don't know if it will help, but why have have you got the positioning, scaling, locking and setting collision on inside the loop?

Current Projects: 'Level Editor 3D' and 'Animation Package v2.0'
[email protected]
stann65
21
Years of Service
User Offline
Joined: 3rd Feb 2004
Location: england
Posted: 11th Apr 2004 21:16
i have no idea i was just playing around with things and it seemed to be ok.

stann65
21
Years of Service
User Offline
Joined: 3rd Feb 2004
Location: england
Posted: 12th Apr 2004 15:05
i didn't mean seemed OK as in the collision was working but as it was just running fine please help with the collision.

bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 12th Apr 2004 15:15
It may be to do with SCALE OBJECT, when you scale an object, DB uses the original object size for collision and yeah, you dont need LOCK OBJECT, SCALE OBJECT, SET OBJECT COLLISION ON AND SET GLOBAL COLLISION ON inside the main loop.I think GLOBAL COLLISION is turned on by default anyway
stann65
21
Years of Service
User Offline
Joined: 3rd Feb 2004
Location: england
Posted: 12th Apr 2004 15:26
thanks but can you put how i would stop the camera from been able to move forward when object 1 has collision with the cube.

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 12th Apr 2004 20:55
Why don't you make static collision boxes for the objects you collide with and make the camera collide rather than the gun?

Current Projects: 'Level Editor 3D' and 'Animation Package v2.0'
[email protected]
stann65
21
Years of Service
User Offline
Joined: 3rd Feb 2004
Location: england
Posted: 12th Apr 2004 21:05
because i don't know how to make the camera collide that is what i need to know so i can continue with my game.

muscles
21
Years of Service
User Offline
Joined: 12th Apr 2004
Location:
Posted: 13th Apr 2004 22:05
i use math collision more than anything else, so collision boxes and all that aren't my forte. but, instead of using the camera for collision, you could make a sphere, position at the camera's location, hide it, and check for collision with the sphere instead of the camera. just a suggestion, hope it helps...
bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 17th Apr 2004 15:03
maybe its because your positioning the camera before setting "moveable" to zero, would have to see more code

Login to post a reply

Server time is: 2025-05-23 16:38:29
Your offset time is: 2025-05-23 16:38:29