Hello, I’m making an endless runner game, and I have a car that will move forward and hit an enemy. But when it’s moving, it doesn’t collide with the enemy. But if the enemy is overlapping the car when it spawns, it collides normally. I’ve tried just moving the static mesh, and I’ve tried moving the whole actor (which is what I’m currently doing, and what I was doing). I’ve done this before and it worked. I can’t imagine why it stopped working all of a sudden. There are no collision changes while the car moves, and the enemy collision never changes either. everything works fine while the car is static, but once it starts moving, it stops colliding (but it will still hit and interact with physics bodies, and the collision type is set to query and physics enabled)
Show me Blueprint, Whats the way you are doing to move Car?
-
Check Sweep in SetActorLocation.
-
Without sweep, it will just jump to Location without checking collision.
-
If still collision doesn’t work, then change Mesh Collision preset to “Block All Dynamic”
-
If still collision doesn’t work, then Add single Box Collision or more collisions according to shape of Car and set collision to Root, And Mesh is Child of collision and set Collision preset to “Block All Dynamic”
None of that worked. Some more things I’ve noticed and thought I should mention, is that the car will still collide with the pawn. And the enemy and car are child actors of the same parent actor, in case that means anything. Here is the collision for the pawn, car and enemy, respectively (I need certain collisions to be set a certain way for different parts of the game):
- bSweep
- Whether we sweep to the destination location,
- triggering overlaps along the way and stopping short of the target if blocked by something.
- Only the root component is swept and checked for blocking collision,
- child components move without sweeping.
- If collision is off, this has no effect.
It isn’t working. I’ve created a video in case it helps: UE4Bug.mp4 - Google Drive
- Only the root component is swept and checked for blocking collision
- In your video, DefaultScene is Root, So the Collisions of Car Mesh doesn’t work with Sweep
- So, set Car Mesh as Root, or Box Collision as Root.
I did that and it still doesn’t work. Could the blueprint have been corrupted or something? Because this all worked before, and without changing anything, it’s suddenly not working anymore.