Set Collision Enabled successfully disables collision on box, but when i want to enable collision it makes nothing and IsCollectionEnabled returns false without any error. The SetMaterial works fine with the same actors after trying enable the collisions.
You probably need to show more of your Blueprint for anyone to understand what you’re doing. For example, why do you have a for loop through an array within the actor’s blueprint itself, when resetting the collisions? Are you sure no other node somewhere contradicts with what you are trying to achieve? I feel like we have little information to help you here…
I am disabling the collisions so i dont count some objects twice, and i need to reset all collisions to enabled if i go on a wrong panel. (need to repeat the minigame) These objects are called only here.
Hmmm… first of all, you’re doing something funny with that bottom for loop that has nothing connected to its ‘Loop Body’ pin. It only uses its completed, I would check that logic first, why is it like that?
Are you sure perhaps there aren’t other interfering overlaps that reset the collisions to NoCollision again? Who calls SetCountToZero and are you sure the overlap isn’t called again when it shouldn’t?
Ah saw something else: if I’m right, elevate this comment to an Answer for your question: Again with that bottom for loop, you don’t find the actors of CheckBox_True, but Database_Actor instead. Could it be that you are resetting the collisions to the WRONG actors?
The for loop is from the database actor (keeping global variables), and there is only 1 of it so the completed and loopbody gives same result. But changed it on simple “GET”.
I think found out something. Is it possible that the SetCollisionEnable triggers the Event ActorBeginOverlap for the all the CheckBox_True where collision was previously disabled?
Here is video how it works
I mean, this is plain incorrect. It’s setting the value of the last element only and Get All does not even guarantee element order - so we don’t know which object this refers to. Also, perhaps read the tooltip of the Get All node before spamming it everywhere.
- and this is even worse:
Use the Loop.
Just a note, you’re also referencing a plane directly, within this blueprint, in the bottom just before the collision node.
If you’re turning Off the collision with the same node (with NoCollsision selected) there’s no reason I can find that it wouldn’t be working just fine.
The only way I can make it Not work is by removing collision, so there’s nothing to turn back on.
Got it. The collision box overlapped with other objects and when the collision was enablet it triggered the ActorBeginOverlap event what disabled the collision again. Moving the box little bit up from plane fixed the thing.
Yeah I flagged that to him, but he said he knows there’s only one element… but still I agree, this is not how it’s supposed to be hooked up.
Moving the box little bit up from
plane fixed the thing.
No worries, they’ll be back with another question regarding why it still does not work. This is simply not set up right, a 101 of blueprints - it’s called ForEach
for a reason…