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 Physics & Dark A.I. & Dark Dynamix / Problems Adding Force (Dark Physics)

Author
Message
Overlord Bob
15
Years of Service
User Offline
Joined: 3rd Nov 2008
Location:
Posted: 24th Jan 2009 20:27
Recently I've been playing around with the "shooter" code, and I tried replacing the balls with a ray cast function. I managed to implement it, but I'm running into a problem when I target the ground.



Whenever I target the ground, it crashes because the engine tries to add force to a static object. I tried to get around it by this:




This sort of solved my problem, but now it isn't applying force to anything at all, including dynamic bodies.

Does anyone have an idea on how I could fix this?
Thanks in advance
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jan 2009 21:18
will this work.

if not hitObject>ground
phy set rigid body linear velocity hitObject, 150*sin(angy#)*cos(angx#),150*sin(angx#),150*cos(angy#)*cos(angx#)
endif

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jan 2009 21:34
had another thought this might work better.



Dark Physics makes any hot drink go cold.
Overlord Bob
15
Years of Service
User Offline
Joined: 3rd Nov 2008
Location:
Posted: 25th Jan 2009 00:39
I tried your code out, but now I'm having even more interesting bugs...


Whenever I cast the ray, the program freezes completely. No crash, no error message. Do you have any idea why this is happening, and possibly what to to about it?

Login to post a reply

Server time is: 2024-05-23 12:50:00
Your offset time is: 2024-05-23 12:50:00