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 / [DP] How do I make an object be forced in the player's direction?

Author
Message
UltraG
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Right here, where I am.
Posted: 17th Feb 2007 06:19
Hi there. I just bought Dark Physics and am wondering how to push an object in the player's direction he is looking in. I am trying to make a bullet that has physics in a game so I can shoot boxes and things, but I don't know how to get it working right. Thanks for your help, well, if you do help!
The Nerd
19
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 17th Feb 2007 12:44
Quote: "I am trying to make a bullet that has physics in a game so I can shoot boxes and things"


I have that running perfectly in my project right now. It's actually very simple. Infront of every gun my engine loads, it has a limb attached to it where I can position the bulllets. To figure out what rotation the bullet will have(witch way the bullet will shoot), I just rotate it with the angles of the same limb. Now that my bullet is positioned and rotated, all I need to do is to push the bullet with a one-time force using the command phy add rigid body local force. I'm also giving the bullet a mass. Not that it has to be that big though hehe.

If you would like to see how it looks in my project you're welcome to download this small video so you just get the basic idea:
http://www.nerd.galekus.com/CiCon_EngineMov5.wmv

I hope that helped you a bit But if you have any more questions about then just ask!

UltraG
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location: Right here, where I am.
Posted: 17th Feb 2007 16:20
Thanks, that should help. A question is, what force axis do I apply the force to? I'm guessing z.
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 17th Feb 2007 16:52
UltraG
Here is a link to a thread I submitted a while back I think you will find it useful.


http://forum.thegamecreators.com/?m=forum_view&t=87143&b=30[href]null[/href]

I find the best approach to applying force is using Vectors. If you have never used them they appear complicated but once you understand the concept they are an ideal way to apply force.

Hope this helps
codger

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem

Login to post a reply

Server time is: 2024-04-26 17:52:38
Your offset time is: 2024-04-26 17:52:38