Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Collision for Shooting (Tips & Tricks)

VP
Guest
Quote
2022-12-21 14:55:48

I started making the FPS element for my Rebel County game as a short game for BulletChain's FPS Game-Jam on Itch.io

I ran into a major problem which I managed to solve and wanted to share/document.

The issue I was having:
The enemy model is an animated spider. It's hot box (where it can be shot) was a huge box surrounding the entire model.

Literally anywhere I shot would hit the spider - even if it looked like it should be missing (it was still hitting the huge box).

I made a dummy node (small cube) and attached(childed) the spider to the cube. I put the game character behaviour on the cube, instead of the spider. It still didn't work - the bullets were still hitting the spider model's hit box and not the cube - so now I couldn't hit/kill the spider at all.

Workaround:
By turning the model inside out (by giving the x-axis a negative value and applying double-sided materials to the spider), it effectively turned the collision off for the outside of the model - allowing the bullets to pass through and hit the dummy cube.

It works well enough, but it's not perfect. If the player shoots at the spider and misses, the bullet will hit the spider model on its way out - but as the spider's game-behaviours are on the dummy cube (not the spider model itself), it doesn't really matter as you'll never really notice the issue.

It's seems like a good solution for being able to create an independent hit box which isn't determined by the bounding box of the model.

Bonus:
I was also able to child a second box to the hitbox and I set it's collision to "on". Now, even though the spider walks (with collide when move), it also has static collision so you can't walk through the spider when it's alive or dead - it's a solid mass - you can now even jump on top of it and go for a ride, lol.


andgameplay
Registered User
Quote
2022-12-23 18:50:52

Hi VP, I don't know how to solve this, but did you tried to do this without the "cube childed"? To shoot only in the spider model? Maybe in this simple way can work well.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact