My problem is that my character wont stay still inside the cabin.
How could I fix this?
I’ve already changed and experimented with the characters “Character Movement (CharMovComp) (Inherited)” component because I thought that the problem had something to do with the physics.
These are some of the blueprints for the cabin…
Before I tackle the solution, I’m going to approach it with a few questions first.
Does the cabin have to move? I ask because most of the time, that’s a “no” it only has to appear as though it is moving. That is easier to handle.
Is the player “riding” the train or is the player supposed to be able to move around the train while it is in motion? If the first, then you can simply attach the character to a socket while boarded. If the the second, then it’s trickier.
What happens if you just place the player character into the cabin and start the game? Unreal is pretty smart about things and most of the time, you don’t even need to do anything special. (I know in your example, you say the player moves forward but I doubt this is natural behavior. I’d bet you’re trying to match the cabin’s speed.)
So what would I do?
Make the player a child of the cabin during that game mode. But this might not be ideal since child objects tend to ignore parent collisions.
or…
Set the player’s position to the cabin’s position plus/minus some offset value so he can move around.
Thanks for replying. I will answer your questions:
Yes… at least that’s what my levels are set up for.
I want both functions, but most of all I’d like the character to be able to move around in the vehicle.
Having my character as a child of the moving cabin, not parenting the character and just placing it inside the cabin; both methods work better when I slow the cabin down. Your suggestion seemed to have solved the problem until I sped the cabin up.
When it goes too fast the character is literally shot into “outer space”.
When the character is a child of the cabin the effect of the character moving forward is just allot stronger. Example : at the slower speed I can actually walk against the effect, but at the faster speed I can’t… I’m stuck to the wall.
That’s why having the character as a child of the cabin seemed like the better solution.
Never mind, your suggestion worked, it turns out that in my level the sky sphere was colliding with my character, causing it to act very weirdly. I removed the sky and the method you suggested worked.
Thanks.
You can always set the sky sphere’s collision to none.
If it’s a custom sphere, go to the static mesh object and remove any collision. If it’s a blueprint, you can go to its collision settings and set it to none.