I cant attach my actor to a component

I try this:

The actor is a ball and the component the player mesh, the ball spawns at socket position but dont attach to track the player movement.

1 Like

Greetings @Izmaaeeloo !

I see this is your first time posting in our forums! Welcome to the Unreal Engine community! :medal_sports:

Just so you know, I had to move this topic from Legacy - UDK Programming and UnrealScript to Programming & Scripting - Blueprint. I added the optional Components tag for you.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Happy Developing!

'- Your Friendly Neighborhood Moderator

1 Like

I can see you are spawning an actor but you aren’t attaching that actor. The Target pin is empty on the AttachActorToComponent node. You should connect the spawned actor to that target.

True, but I forgot to connect it because I was cleaning up the code a bit, but it still doesn’t work.

Could you post an updated image?


Also, you can remove the Cast node, it does not do anything here - see the blue note.

This is how I have it right now

How certain are we that the mesh has a socket spelled like this?

It has, I have checked it, what happens is that the ball spawns in the right place, but it doesn’t hook to the bone.

As a test, could you disable physics and collision for the BP_Pelota’s Pelota mesh without using nodes. Essentially, untick Physics Simulation and set collision to NoCollision.

that way it does work but how can I disable physics and collisions without affecting that node?

Probably, what you’re experiencing is an old bug that will never get fixed.

edit: Not really a bug - the simulating comp must be the root, see below.


Can you briefly explain how this is going work? For example:

  • why are we simulating physics in the first place. Here you’re spawning an actor and attach it. So simulation does not seem important to start with. But it may be later on? Or perhaps this is just a test, but the real scenario will be like so: the player picks up a helmet that is rolling on the ground?
  • in the actor being spawned, how does the hierarchy look like. Is the static mesh the root of that actor?

@Izmaaeeloo I added a couple of questions, could you clarify?

Okey, thank you for your help!

It is a soccer ball, what I want is that the player catches the ball between his feet so it does not escape, and for that I decided to remove the original actor and generate another in a socket on his foot, (the head is just a test).

The mesh is of type SkeletalMesh

1 Like

The ball is a skeletal mesh? Just making sure.

the mesh of the character I mean, the mesh of the ball is staticmesh

Could you show the hierarchy? Is the static ball mesh the root of the actor?

Like this:

image

Or do you have another root?

Jerarquia

Yup, that will be it. The element that is simulating and colliding must be the root - drag it there.

When you then disable physics / collision - use the appropriate component. Here it seems it’s the DeteccionDeColision that is responsible for that job. The mesh should have no collision, no physics. That sphere collision does the heavy lifting.

So probably something close to this:

And since the mesh is not really doing anything anyway, this should be the DeteccionDeColision:


Gave it a go and it produced this:

This is without spawning a new actor, I just disable physics + collision on the root component.

then I must disable physics and collisions in “CollisionDetection” and make child the root component?

Pretty much.