HitboxComponent on an object with a CarryableComponent #104
-
Anyone know how to combine these two components? The Carryable Component must be a rigidbody, but the HitboxComponent IS a rigidbody.... Placing the HitboxComponent on a plain Node3D doesn't seem to work. I can't place it on the parent object of the item because it is a Cogito_Object already. The collider needs to be a HitboxComponent to deal damage, but I wont be able to pick it up too if its not a CogitoObject. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
I made this work with the laser now by changing the hit_scan_damage function to look for children. func hit_scan_damage(collider): I'm not sure if there was a different way you intended to support using these components together @Phazorknight ? |
Beta Was this translation helpful? Give feedback.
-
Looking into this now, but not sure I'll be able to fix it today. The idea is to make the HitboxComponent work by just droping into your objects like any of the interactions or the ImpactSounds. |
Beta Was this translation helpful? Give feedback.
-
Ok, I've implemented this in 6f5930b The commit notes should mention how it works, but it's pretty straight forward. Simply attach it to a CogitoObject (it HAS to be a cogito object) and make sure it has a reference to the object's HealthAttribute. This should make it compatible with all other components, for example the red barrel in the Lab scene can be carried around and still works with the HitboxComponent. All current damage dealers have been updated to work this way. This means currently these can only damage CogitoObjects. |
Beta Was this translation helpful? Give feedback.
Ok, I've implemented this in 6f5930b
The commit notes should mention how it works, but it's pretty straight forward. Simply attach it to a CogitoObject (it HAS to be a cogito object) and make sure it has a reference to the object's HealthAttribute. This should make it compatible with all other components, for example the red barrel in the Lab scene can be carried around and still works with the HitboxComponent.
All current damage dealers have been updated to work this way. This means currently these can only damage CogitoObjects.