Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Bullet + Level collision (IMPORTANT)
Topic Started: Dec 3 2007, 01:40 AM (265 Views)
Links
Member
[ *  * ]
I can only imagine how wrong this can be but it's the closest to right (but still horribly rare) collision between the bullet and the level. Please someone who understands, help me get the perfect code for this so the bullet will always collide with the level.

Code:
 
//hor?

distance_levelz=GetDistanceToModel(level.id,x+2,y+2,z+2,diry,dirx);

if distance_levelz <6 {instance_create(x,y,Ricochet); instance_destroy();}

//vert

   distance_forward=GetDistanceToModel(level.id,x-2,y-2,z-2,dirx,diry);
   if (distance_forward<6) {instance_create(x,y,Ricochet); instance_destroy();}


The bullet uses the MoveObject script, with commants dirx and diry.
Offline Profile Quote Post Goto Top
 
Links
Member
[ *  * ]
Help?
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply