Me again :D

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Me again :D

Post by turshija »

I know I'm a real pain in the ass with all these questions and stuff but I simply want to learn new things :)

now I'm having problems and questions with collisioning ...
In tutorial 3 you have explained something about collision ... Now everything is fine when I want to detect collision between Player (sphere or something) and wall... But problem starts when I want to detect collision between 2 players ... Help when you can :)

Boris
Yo mama's so fat that a recursive function computing her weight causes a stack overflow.
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Try this:

Player category 0
Wall category 1

Define collision 0 versus 1, player vs walls.
Define collision 0 vs 0, player vs player.

Then in OnCollision on PlayerModel, you test with an expression what the player have collided with.

Code: Select all

if(App.CollidedCategory==0) {
  //do something
} else if(App.CollidedCategory==1) {
  //do something else
}
Another variant would be to have separate models for Players, like
Player1Model and Player2Model with separate categories.

This forum is here to help, ask as much as you like :)
Post Reply