Making puzzle pieces that move with collision

I am brand new to programming so I apologize if there is an easy answer here. I’ve tried a few methods and ran in to issues with each. I tried using the timeline method but couldn’t successfully get the moving pieces to have collision (I think it’s because timelines repeatedly teleport the actor?). I’m now using the “InterpToMovement” component. Collision works but the actor can only be “activated” once. My left click takes it to Position 2 and right click takes it home/Position 1. I’ve tested the setup and the piece moves to each location fine but like I said, it only activates once then it just dies. I’ve done so much googling, tried the “finalise control points” node on “interp to stop” and all sorts of other things I’ve seen people say but something is not lining up for me.

If anyone has any suggestions, I would be so thankful, I’m so tired of slamming my head in to this one

Current base flow is:

  1. Left/Right click event
  2. Each have independent “add control point position” with Vector variables tied to world position, chosen by my puzzle actor
  3. Activate

I didn’t quite get what might be the problem here. Normally the collision bounds of an actor shouldn’t go anywhere (I mean, should stay on the actor) unless you’re expecting the collisions to follow an animation. Could you send the screenshots of your blueprint code where you handle the movement of the actors? Also, could you clarify what you mean by collisions? The collision bounds of their meshes, a collision volume (box, sphere, etc.) that you added manually, another actor that doesn’t have a mesh but just a collision which is supposed to follow the actors? It would also be very helpful if you could provide a video demonstrating the issue. If you’re not able to upload it on this platform, you can upload it to YouTube and send it’s link.

Sorry, by collision, I want the actor to stop when it hits another solid actor. I will try and get something to demonstrate the issue

If I understand what you want to do correctly, you are trying to make that wall continuously move up and down to certain points? @uuiioo21

You can simply achieve that like this :innocent:

And here’s the outcome:

Note that you’d need to set your actor’s mobility to movable for this to work.

Oh and also, the reason your overlap events not working might be due to the collision you have on your actor not being big enough. To fix that, you can add a box collision to your actor that’s just a little bit bigger than your actor.

Hope this helps! :blush:

Not continuously, i want the player to be able to switch it between two points. Like an on/off and i want it to stop if anything is in its path

To do that, you can promote the New Transform Location pin of the Add Actor Local Transform node to a variable and multiply it by -1 whenever you call the custom event that opens the gate (which is called “Move” in my example), and you can set the default value of that vector type variable that we just created to your desired direction :blush:

Thank you so much :pray:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.