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 / Collision problems again

Author
Message
xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 30th Jan 2009 05:51
Ok, not really too much help on my last post, so here's hoping that this one will go better. i have a function to control a player defined as so:



I am using SC_SphereCast to try to detect collision with my walls, however, this code will not prevent me from colliding with the walls. when i tried to modify the parameters for SC_SphereCast, I was prevented from walking through the walls, but could only walk one direction on the z-axis. seriously guys, what am i doing wrong and how do i do this???
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 30th Jan 2009 07:00 Edited at: 30th Jan 2009 07:01
"SC_SphereCast (PLAYER, PlayerPosX, PlayerPosY+20,PlayerPosZ,PlayerPosX, PlayerPosY+20, PlayerPosZ, 20, 0)"

You're casting a ray from one position to the exact same position? What happened to using your OldX/Y/Z values?

Also 'SC_SphereCast()''s first param takes the object you wish to test collision against, which in this case appears to be PLAYER? But this is your player's object and I assume you don't want self collide, in this case remove the '== collideObj' tacked on the end and replace PLAYER with that variable.

xix psycho xix
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 30th Jan 2009 13:16 Edited at: 30th Jan 2009 13:39
collideObj is set to the value WORLD, which has the same id as the actual world im using to check for collision. And how exactly does spherecast do what it does? Im not exactly sure i understand the point of the parameters x, y, and z if there is a defined radius.

Would i maybe be better to use SC_sphereSlide, as suggested by sparky's help files? Can anyone show me an easy example of how this will work?

Login to post a reply

Server time is: 2024-09-30 17:34:16
Your offset time is: 2024-09-30 17:34:16