so i am using Godot 3.2.3
and i am trying to creat a simple game 2.5d
here is what i am trying to do .
i am making a “ temple run game like” where you are a car trying to avoid other cars in the road .
when you collide with other cars your life should go down by 1 till you have no more lives .
the cars , player and obstacle cars should never physically collide with each other but have there collision detectors only , more like ghost.
i am using the layer system where the player is on layer 1 and mask 2
other cars are on layer 2 and mask 1 . but its not working
Question
what am i doing wrong ?
This sounds more like you aren’t using the correct nodes. Character, Rigid, Static, and Vehicle bodies have collision, meaning they collide with each other, push each other, get stopped by each other etc. If you want them to act like ghosts then you should use Areas which do not collide with anything but detect when an area or body have entered or exited them. So either or both your cars and player should be areas. If you need both real collision and area detection then you can make your bodies real bodies and give them Area children. I usually do this like this:
- Player collision (layer 1)
- Player hurtbox (layer 2)
- Enemy collision (layer 3)
- Enemy hitbox (layer 4)
The player body is layer 1 and has a mask of layer 3. The enemy bodies are layer 3 and have masks of layer 1. The player has an area which is a hurtbox of layer 2 and mask 4. And the enemies have hitboxes of layer 4 and mask 2. That way the player and enemies collide with real physics, while the enemy hitbox area detects when it enters the player hurtbox area and triggers the get_hit function.
1 Like
ok thank you for your response .
i will see if this works and be back !