The game has an elevator. If a player uses it to move up, then at a high elevator speed, he can fall through the floor. And while the elevator is moving, the player is pressed to the floor.
Therefore, in the elevator there is a trigger, at the entrance to which the player must become a child of the elevator.
But I’m getting this error:
AttachTo: ‘/Game/Levels/UEDPIE_0_WayOut.WayOut:PersistentLevel.wayOutElevator_2.StaticMeshComponent0’ is not static , cannot attach ‘/Game/Levels/UEDPIE_0_WayOut.WayOut:PersistentLevel.PlayerStart_1.CollisionCapsule’ which is static to it. Aborting.
How can I make player a child object of the elevator?
according to the error it looks like your trying to attach the player start not the player character. The error is basically saying a static object cannot be attached to a movable object. so set bot actors to the same status either moveable or static.
Yes, I trying to attach player start. I can’t attach player character because it is not on the scene.
Player character and elevator are both movable but player start is static and I can’t change it.
What do you mean move with the same transform? I move only the elevator and player moves with it
I have a lot of stuff like this, platforms and boxes moving around pretty quickly, and the only time I get a problem is when the player hits an object that has collision.
I guess you could make the lift move the player pawn with the same transform.
Would be insterested to hear from anyone else who knows if there is a ‘right’ way to do this…
When your code moves the lift, it could also move the pawn. Maybe you have a timeline to move the lift, you can use the same timeline to move the pawn, with the lift.
Player Start is static. I would not try to attach it. Instead, on Possess or on Begin Play, let the character spawn as normal, at the Player Start, and then immediately teleport the character to the elevator, and attach it. This will happen before the first frame is rendered.
You don’t need to attach the player to the elevator.
Make sure your character Collision is in Pawn and that the floor of your elevator does Block Pawn. This way, the Elevator will physically bring you character upward/downward.
What do you mean by teleport? Player decide when to move on the elevator. And how can I attach it?
Now I try to attach PlayerPawn, not PlayerStart. And with it I don’t have error but Player still don’t became a child
I mean the node Teleport. You can move the Character into place, and then attach it. (Although the Snap to Target you’ve used might do the work for you).