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.

Newcomers DBPro Corner / Problems with positioning Dark Physics rigid body

Author
Message
scutheotaku
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 10th Dec 2009 04:45
First of all, I'm not sure if DarkPhysics is the issue, but I couldn't come up with a better name

Now, for my problem. Ok, so I did Zaibatsu's Dodging Game Tutorial : http://forum.thegamecreators.com/?m=forum_view&t=153346&b=7. And it all worked great (which is why I didn't just post this in that topic). Then I started experimenting with DarkPhysics and such, and getting fancy. Now, I have a problem.

What's supposed to happen in the game is, you control the ball moving it only left and right. Then, other balls are rolling towards you. You have to avoid the balls and let them roll past you. For every ball that hits you, you lose 20 health points (out of 100), and that ball moves to the starting point, only with a random x level (that is hopefully within the level ). If a ball rolls past you (or, to be more specific, if it's Z value is larger than 145), then the player gets 1 point and then the ball is supposed to jump back to the start with a random x value.

Well, everything works fine except for the jumping back part. Once they get past that point, they just disappear. I'm not really sure what's wrong, all I know is that all the code worked fine before I added DarkPhysics. Then, once I added DarkPhysics, everything worked except for, apparently, the position object command. Can you not use that command with a dynamic rigid body? If so, what can I use instead?

If that's not the problem, then I'm not sure what is. Here is all my source code (I tried my best to give informative remarks, especially since you won't easily be able to run it without removing or replacing the textures)-


Any help is much appreciated. Thanks for helping a DBPro n00b out!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 10th Dec 2009 12:25
try using this

replace this

position object 2,rnd(37.5),5,-90

with this

phy set rigid body position 2,rnd(37.5),5,-90


because once the object becomes a physX object this is the only way to move or re-set it.

Dark Physics makes any hot drink go cold.
scutheotaku
14
Years of Service
User Offline
Joined: 9th Dec 2009
Location:
Posted: 10th Dec 2009 12:50
Thanks, that worked. I feel kind of stupid missing that, but I couldn't, for the life of me, find that command in the DarkPhysics documentation. I guess that's why I shouldn't code when I'm tired, haha

Login to post a reply

Server time is: 2024-11-24 23:43:17
Your offset time is: 2024-11-24 23:43:17