Can I attach a BP to a model in the level and then detach via BP?

I need to attach the player to a platform when it starts moving. It’s a quick movement so he’s frozen while it happens…but it’s a quick time line so sometimes he falls through. Could I attach him to this model? The model is being moved in the level BP…so I figured I’d attach and detach him in there…how can I do that?

Yep, there’s a node called “Attach Actor to Actor” for doing exactly this!

BAMB!!! You da man!

well just because they are attached it probably won’t stop them from independent movement if that’s what you mean. you’ll want to keep track of whether they are attached and ignore any inputs if they are.

no, once it’s attached any movement or rotation applied to the platform should be applied to the attached player. does it not?

actually…
It seems the any moving platform I attach my character too is just glitching out once it starts moving. I’ve got the node set to keep world position…as I figured that would do the trick./.
HOW can I make the character be stuck on this platform (Attached) and no matter where it moves he he stays where he is only the platform?? I understand how to detach after the timeline for the platform is finished but…just wondering. how can I Make the character NOT be able to move off of it. via attaching. Is there something else about it I need to know??

I Have the controls to be ignored while they are attached sense it’s only for a couple seconds at a time. The platform moves on a timeline…quickly…And it seems the character just gets sent through it or something…
I’m not sure how to stop that from happening.

is there a certain way people go about putting a player on a quickly moving platform??

Should I set a timeline for the player AND the moving platform?? is that how it should be done???

It acts a little funny…Like…
I attach the player and then turn off control and trigger the timeline of the platform. Sometimes the attach either lets go or it just glitches out…and makes everything look jumpy for a second…it very seldom works.

if the platform is moving DOWN I will speed through it and fall to my death. pretty much. if i’s moving up i may fall through it…its like…buggy

Could gravity affect this?? it’s setup a little more like out in space…I wasn’t sure if that would cause everything to glitch out. I’m using the default player pretty much…It’s a really simple setup.

you might want to try disabling physics on the player and set the velocity of the movement component to 0/0/0 after you attach it. then restore physics after detaching.

Yes, that’s why I suggested turning physics off for the duration. See my note above. :slight_smile:

Im not sure…My character is just a camera and a collision component…If I set simulate physics on the collision component it just glitches out…
i’m so confused.

And honestly looking at it now, the simulate physics is turned off in the componante tab of the player BP…

Personally, I wouldn’t attach the character to another mesh. I would use some form of collision detection (e.g. trigger) to know the character is on the platform, parent it to the platform you want the character to move with, disable the character’s input during the timeline; and then using the event tick, I would update the character’s transform/location to the same as the mesh that is moving (plus what ever offset you need for the character sit on the platform the way you want, (e.g. (platform_x, platform_y+offset, platform_z)). I’m not sure about UE4, but in Unity, when I am manipulating a child object I would use local transform data (e.g. instead of world space the transform values would look something like (0,0+offset,0)). But, also in Unity (not sure about UE), if you move the parent object, the child’s world space coordinates move with the parent.

I haven’t tested this, but this seems like the proper logic to me. Attaching a skeletal mesh to a moveable static mesh just doesn’t sound like a good idea…

So does anyone know of a node a could use in the BP to parent the character to the platform or the other way around???

I do disable the players input and yes that helped for sure. but attaching was not the way to go…you are correct.

I had the character and the mesh move on the same timeline as well and it seemed to not like it…

Im getting closer but still game breaking. Thinking parenting may work…I just don’t understand the difference between that and attaching.

Well, after looking into parenting, UE4 documentation states that “Attach to” is the act of parenting. So that rules that out as an issue.

I wonder if it’s the rotation jittering… Have you tried to freeze the rotation? something like in this thread . With this event?

Rotation jittering?? Where exactly would I freeze rotation…and u mean from the player controller?
When I step on the platform I freeze all movement except for the player rotation…so you can still look around…
Is it collision???
I enabled substepping…it seemed to help a little…It’s almost like performance based but I dunno why.
When there’d more happening in the level I feel like the chance is higher…but I could be wrong about that. .it works fine sometimes. It’s just there is a random chance you fall through. Is collision nor updating fast enough???

I was referring to freezing the character’s rotation if you were still getting the glitching while the platform was moving. If you want the character to still look around, you can pick which angles to freeze, instead of completely frozen. The two links I posted above show how freeze rotation.

As far as the character falling through the collision…

Have you tried expanding the bounds of your collision?

Are you using collision you have set up with the static mesh? Or, a movable blocking volume?

Have you tried attaching a movable blocking volume to the platform.

I did a side scroller in UDK, and had gotten this issue before with collision set up in the editor and with importing collision as UCX_meshName. I ended up attaching a blocking volume to the mesh and it stopped allowing the pawns to pass through. My pawns, though, were being launched at a pretty high velocity at the mesh with collision.