# Why is my mesh outside its collision component grid?

I've created a blueprint (well, two of them, as a test since the first one wasn't working right) with an sphere component around a mesh, as in the picture:

As you can see, the mesh is well placed inside the collision component outer grid lines, but when I place this blueprint in the editor the mesh appears displaced from the grid:

I've checked this is not a merely visual bug of the editor; the collision component is really at different coordinates than the mesh, making all kind of strange collisions and side effects. However, I fail to see why is this happening, or what can I do to solve it. The blueprint is based on a custom C++ class, but I'm not making anything related to position in there. I paste the full code of that class:

#include "FPSBall.h"

// Sets default values
AFPSBall::AFPSBall(const FObjectInitializer& ObjectInitializer)
{
// Crear una malla
MeshComp = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("Mesh"));
MeshComp->SetMobility(EComponentMobility::Movable);

// Crear un component esfèric per a les colisions
CollisionComp = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(this, TEXT("Envolvent esferic"));
CollisionComp->BodyInstance.SetCollisionProfileName("Pilota");
RootComponent = CollisionComp;

// Valors inicials de transformació
Velocitat = 0.0f;
Direccio = FVector(1, 2, 3);
Rotacio = FRotator(3, 2, 1);
}

void AFPSBall::Shoot(float velocitat, FVector a_on, FRotator spin, FVector hit)
{
Velocitat = velocitat;
Direccio = a_on;
Rotacio = spin;
CollisionComp->AddImpulse(Direccio * Velocitat);
}


Can anyone point me towards a solution? I could try to fix things in the class constructor, but I fail to see why this is not working out-of-the-box and I don't want to try fixing things that shouldn't be broken to start with.

## 1 Answer

Make sure your mesh ignores collisions. Or atleast it ignores the collision component by setting channels to ignore eachother.

• I've set the "Collision presets" on the mesh to "NoCollision" and recompiled, but no changes. :( – Rekesoft Apr 23 '19 at 19:25
• Make sure it has no collisions also in BP, – ColdSteel Apr 23 '19 at 23:05
• Make sure you dont use hotreload, this feature is bugy and breaks blueprints (in case you are not on 4.22), make sure you close the editor compile in VS and then open the editor, in case the bp is already broken by hotreload you will have to recreate it. – ColdSteel Apr 23 '19 at 23:06
• Also check that no sphere or mesh dont affect navigation – ColdSteel Apr 23 '19 at 23:07