Hi, I’ve set a Blueprint actor with a Static Mesh Component (the mesh has collision set in the Static Mesh Editor -if it’s still called that way-) and the component in the Blueprint has collision to “BlockAll”.
I have a character pawn that collides everything as expected in levels, but with that particular Blueprint actor something strange happens: if the character moves towards the Blueprint actor they collide, but if the character doesn’t move the Blueprint actor can go across the pawn as if there was no collision (the Blueprint has a graph to move every tick with “Set Actor Location”) .
Do you know what might be causing this? I’d like to set things so they always collide.
The issue you are running into sounds like your graph is actually setting the Actor Location to a spot that your pawn already occupies. In this case, the block would not occur because the object is being set to that exact location. You may want to look into adding an Overlap event to the component that is moving and if it hits a pawn, have it move the pawn a short distance to the side out of the path–maybe using a Normal vector?
If you want to post a screenshot of your graph, we may be able to provide a better suggestion.
Hi and thank you, Steve.
I solved this issue some days ago just in a very similar way to the one you mention (using an BeginOverlap event and check if the Other actor is the pawn, if so it pushes the pawn with a SetLocation function as it would be expected in the real world), but I forgot to write it here.
There is a more practical way to do this.
The topic is a bit old, but I want to add the solution in case it helps. I struggled with this problem for a long time.
If there is already a collision before starting the game, you can solve it with the help of a short code using Event begin play or Event tick.