- Home /
Armour wont attach to player - child object wont move with player - also collision issues when attached
Hello, I was hoping somebody may be able to help. I'm quite stuck at this stage. So here are some of the details.
I have a Player that moves around via key control and this all works well.
I have made an armour called 'crust' it has its own health and once it hits zero it vanishes. It also changes and cracks a little as it takes damage, a bit lake vase. it has 4 breakpoints so to speak. - that part works.
I added the collider that takes damage great.
attached it to the player as a child...
The 2 colliders clash and my player pushes the crust off. Basically the player refuses to wear his armour.
B plan - make it an illusion. So I have the breakpoints etc and I have removed the collider from the armour and tried to attach it to the player and for some reason. When I try to attach it. it won't move around the player at all. Now if I stick that colider back on the armour they will clash with each other and the repel.
I wanted to make it so that the game object armour actually doesn't need a collider, it just needs to show that it is breaking and whilst it is being worn by the player. basically the player is invulnerable whilst the crust armour is worn.
I have tried a couple of ways of working around this to no avail, could anyone help me get that armour moving or sticking to the player please?
Thanks,
Answer by Getsumi3 · Mar 06, 2020 at 05:37 PM
Hello.
There is a Layer Collision Matrix in Unity (Edit > Project Settings > Physics) that allow you to specify which object can register collision when contacting with another objetc. (NO SCRIPTING REQUIRED)
Full answer: https://answers.unity.com/questions/686915/how-do-i-get-some-objects-to-ignore-collision-with.html
Thanks, I will have to give this a go - and it sounds great!
Just like to say thank you for your answer. It will be very handy for the future where I intend to make a blast wave but this isn't quite what I'm looking for I have come to realise. One big issue I am having - as I am trying to work through one problem at a time - is getting the object to attach to the player and move with the player. When I come to run time I'm finding the armour is either being pushed off of the player, or the player starts gliching with the armour and sticking to the top left of the level. The Armour is a child of the player.
Just to say a big thank you! $$anonymous$$anaged to get it working using the method you suggested. Now it is now case of the armour actually working without the player losing lives!
Your answer
Follow this Question
Related Questions
Tagging a collider? 2 Answers
physics.OverlapSphere colliders 1 Answer
Lock camera (on) ontriggerenter 1 Answer
Multiple Colliders Issue 3 Answers
i can't get an object to respond to collision! (newbie question) 1 Answer