Download

AttachTo would form cycle?

Hello there everyone! :smiley:
I’m Mofoman22 first post here

Let’s get right into it:
I created a** BP_BaseGrenade** to have different grenades in my game, as the **semtex **one, which is the problematic one.

You can see in the execution path highlighted with those handmade fancy red arrows what i made, basically AttachToActor, setting the physics off **and disabling the collision.

It is working nice but it is giving me a warning when i spawn multiple actors sometimes (something that i couldnt figure out why it is happening)
Basically this is the warning message:

  • ** Warning AttachTo:** ‘BP_StickyGrenade_C_3.StaticMesh’** alredy attached to** ‘BP_StickyGrenade_C_1.StaticMesh’ would form cycle. Aborting.

Any idea about how can i avoid that warning? Thank you all! :smiley:

Hey MofoMan22,

I think that what you are seeing is two of your grenades trying to attach to each other:
-Grenade 1 receives OnComponentHit event and attaches to grenade 2
-at the same time, Grenade 2 receives OnComponentHit event and tries to attach to grenade 1

The second grenade though can’t really attach to the first one since each object would be attached to each other “forming a cycle”.

I am not sure if you’d like your grenades to be able to attach to each other - (if not) I would suggest adding another branch checking if the HitActor is of “StickyGrenade” class

Thanks for the response Semitable :smiley:
Wont this make me to check with branching every single sticky element i have with EventHit?
Still thinking about another posible solution that will avoid using multiple branching, anyways thanks for your help! :smiley:

Yeah i dont want my nades to attach haha, and any other posible solution that will avoid the multiple branching, because i have some more “sticky” elements as C4 with hit events aswell that could have the same problem :S

You can give your objects that you want things to stick to a tag called “Stickable” or something. and then on collision check for the tag using ActorHasTag. True = stick, false = keep on going.

I see! It could be interesting doing it the reverse way with non-stickable elements. I’ll give it a try! Thanks

An even better way (but a bit more difficult) would be to create a custom collision channel ( Collision Filtering - Unreal Engine )
This would be a solution where you wouldn’t have to branch and have that extra check…