How to Undo Collision Effects

That looks a lot simpler than when a friend and I tried to code the BP. Though, I do have one more question: did you declare “Start Cube” as a new Boolean variable for that branch after the Event Actor Overlaps?

StartCube is a bool in the parent. It’s only set on the actual start cube.

If you run it as one BP ( only copies of the parent ), then you need it, so that the start cube doesn’t keep checking itself.

Like I say, you can drop it entirely if you put all the code ( except the construction and material switch ) in the metal cube.

Does it work for you yet?

If you get stuck, just come back…

Okay. Do I need to make any changes to the StartCube and MetalCube entities’ BPs?

Which route do you want to go?

  1. Parent BP with children

  2. Single BP

Whichever is easier, really.

Ok. Remove the cubes from your level.

Only put 3 Cube_BP in the level ( just 3 copies of the main BP ).

  1. The start cube, set ‘start cube’, ‘is powered’, ‘conducts’, and materials

  1. The rubber cube. Do not set any of the bools and give it a black material.

  2. The metal cube. Set the ‘conducts’ bool, and choose the metals.

The code is as above ( I’ve changed the post ).

That’s it, no code anywhere except in the Cube_BP, no parent and child stuff.

Tell me how it goes…

The cubes work as intended, except the rubber cube is not supposed to carry or conduct any energy but it does change to its “powered” material, anyway. I even made sure none of the variables were set to true.

Ah, I think I made a slight slip in the code. If you set the rubber cube to ‘start cube’ also, I think it should be ok…

It seemed to work. But, whenever a rubber cube is touching a powered start cube on one side, any metal cubes touching a cube from any other direction or touching the cube along with the rubber one on the same side don’t gain their energy nor do they change material … if that makes any sense?

Can you show me a configuration that doesn’t work? A screen shot or drawing is ok…

I think it’s because they’re all touching more than one cube…

The “powered” cube by the starting one is actually the rubber one. I just noticed this problem, too.

(I can’t post any more screenshots right now. But basically, the rubber cube prevents the metal cube from taking energy when the rubber cube touches first and then the metal one.)

Here are the two other pictures, which I had to put together because of limitations on new users. The left image shows what happens when the metal block touches the starting one, before the rubber one does. The image on the right shows what happens when a rubber block touches a starting cube, along with a metal block.

Alright, we’re back to the parent and child thing. Main parent Cube_BP has this contstruction script:

and this event graph:

( Only the single collision volume ).

The rubber cube has nothing in, except construction from parent.

The metal cube has the parent construction, and this event graph:

Notice, I never used the conducts? variable, because that’s implied by the parent / child thing.

I checked it, many cubes can charge from each other, rubber cube does not charge :smiley:

cubes2

What about the starting cube? When I test the level, the starting cube doesn’t change to its “powered” material. I feel like I’m missing something. Also, none of the metal cubes still change material. So, how did you make the cubes behave the way they do in that animation, with the codes as shown. (I also have the construction script following your example, but I can’t post more than two links because I’m a new user.)

Cube_BP Event Graph

Metal Cube Event Graph

Please see the above post.

The starting cube has nothing in it ( apart from using parent construction ). When you put it in the level, you just set it to IsPowered?

The materials of the rubber and start cube never change, they are set by the construction script. You set the materials when you put them in the level, in the world outliner.

If you can’t get it working, put it somewhere so I can download and see which bit you missed.

( but that’s tomorrow now… )

Okay, here you go.

Here’s the new file, above. And no hurry.

Gonna have a look…

It works, you just got jumbled up about which cube was which.

In your level, you had put rubber material on the metal cube.

and the other way around:

You also don’t need this:

If you can’t get it to work in 5 mins, drop me a line, and I’ll upload a fixed version :slight_smile:

1 Like