Simple collision not working

I have an imported mesh, simple sphere.
Added Sphere Simplified Collision in the editor, selected Block All.
Placed it in the world, made sure was configured to Block All.
~Show Collision displays the wire frame indicating collision is there.

Nothing, walk right through it. Also, hit events don’t pick it up.

This stuff drives me nuts. How hard is it to set up simple collision of an object?

alt text

211839-nocollision2.png

Back to the drawing board, in this case 3DS Max, I created 3 box meshes: 100x100, 200x200, and 250x250.

The only one that blocks me or gets a hit result is the large 250x250 box.

This can’t be right. Is there a setting somewhere to detect smaller objects or is this the minimum detection size?

In the editor, in the collision tab, try REMOVE ALL COLLISION then ADD SPHERE COLLISION.

I created another blueprint, same object and settings, worked fine. Was easier to redo than figure out the root cause.

The root component need to be subclass of UPrimitiveComponent,
So if you set the root component to SceneComponent, it will not block anything.

2 Likes

Thanks, your answer helped me out

how do i do that? please help…

I am posting since I was looking for a solution and found it while googling. Also, I am replying to Bukhari009pppk, so they see it.

I was following this tutorial to create a player and a camera that follows the player. This one to be exact:

The problem with the code was that the root component with the static mesh went through the block volumes. At first, I thought it was the static mesh itself but thanks to Feiwu, I found that I was wrong.

This is what I did to fix it:

In this part of the code:

  RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootSceneComponent"));
    StaticMeshComp = CreateDefaultSubobject <UStaticMeshComponent>(TEXT("StaticMeshComponent"));
    SpringArmComp = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArmComponent"));
    CameraComp = CreateDefaultSubobject<UCameraComponent>(TEXT("CameraComponent"));

Instead of USceneComponent, I used UPrimitiveComponent and voila! Everything started working perfectly!

I guess I’ve written a bit too much, but it took me way too much time to find the actual answer. Everyone goes through the stage of learning and I hope this post helps more people.

3 Likes

How would that work with blueprints?

1 Like