Why is my player clipping through the floor?

I seem to be going around in circles with this one so I thought I’d post here…

I’m building a space game where you are a third person player with a jet pack. I’ve got player movement working just how I want, see blueprint. Notice I’m using “Add force”. Based on my research, this might be part of my trouble. But the jetpack movement really does work fine (and is fun) so hopefully I don’t have to change anything here.

Then I have a spaceship that moves around the level. It is a mesh with custom collisions (collisions setup in 3ds max where i then export to fbx). You can land your player on top of it or you can walk around inside it.

Mostly, this all works great. I can fly around and collisions work. HOWEVER, there is some weird behavior that I can’t seem to fix.

Example: If my ship is moving up and I am hovering above it, collision is not detected and I clip right through the ship (instead of “landing on” the ship when it gets to my foot). See screenshot. Note, this does not happen if I accelerate quickly downwards towards the ship and “land” on it, the collision is registered and I can then walk around. So light to neutral force does not register the collision while strong force does.

This behavior is also repeatable if I stand inside the ship and boost up – I hit my head on the ceiling, bounce down and right through the floor. Really it’s repeatable anywhere on the ship, and any direction it’s moving. But not if it’s stationary; when stationary, clipping occurs exactly as expected.

I read a post that suggested converting the spaceship blueprint to a character blueprint so I could use Add Movement Input, set velocity, add force, and/or add impulse. None of these work, the behavior is all the same–the ship moves around, but it passes through me if I am hovering with approximately “neutral” force in 0g.

See third picture for how I’m handling ship movement–this works currently, but again, the problem with clipping.

I’m going to sleep on this, but if anyone has any suggestions I would be very grateful!

Hi Dave,

I haven’t been able to replicate this but it could also do with the object’s collision settings.

Would you be able to create a small test project with your setup that has the issue? If you project is large, maybe just copying the assets you need into a new project.

Ah, yes, that’s probably a good idea to reproduce in smaller project, I will do that and post back with better specifics about how to reproduce.

I’ve been over and over those collision settings, but it very well may be that, thanks!

Ok, I’ve managed to reproduce from a new project. I’m posting some screenshots. Start from the third person template. You need to setup a new blueprint for the platform (which rises) and add a button for “rocket up” and “rocket down” to the player blueprint. Blueprints screenshots included.

Most reliable way to reproduce (as described in screenshot) is stand on the lower platform and “bump your head” on the top platform (where you then go through the floor)

Thanks!

alt text

alt text

Just to be thorough, here’s one more shot of the behavior occuring with this minimal setup.

Just to clarify, are both platforms moving in unison or is the player being sandwiched by the upper platform lowering on to them?

Both platforms are moving in unison

I set this up but I’m not getting the same results. Here is what I see.

How are you moving the platforms? Also, are you moving them with physics enabled?

Ah, I think it might be related to that. Can you show me your blueprint for the platform? I notice if I turn simulate on and gravity off for the platform meshes, I get some different behavior (they seem to stop moving, I’m using vinterp to move them as per attached platform blueprint screenshot above)

So main question: how are you moving the platforms? :slight_smile:

Yeah, of course. I’m moving the Default Scene Root with a Move Component To node.

Feel free to post a screenshot of your setup as well.

Thanks! I was able to get movement working, and it seems to pick up the collision now from my “downward bounce/drift”, but the collision now effects the platform as a physics object and it rotates.

So I guess I need it to detect the physics-based collision without reacting to it? Constraining to Z position plane worked to stop rotation, but still causes up/down force problem (and seems hacky?)

Any ideas?

Ok, I think I got it. Using MoveComponentTo seems to have helped (see screenshot). Vinterp may have been causing the issue although I’m not sure why. This works with simulate turned off for the box meshes. I’m going to try this is my bigger project now. Any insight greatly appreciated, but otherwise, thanks very much for the help!

I believe it’s where you are simulating physics and moving the object in a constrained way at the same time.

With the ship setup in your game, do you need physics to be on? If so, you have a couple options.

You could set simulate physics to off when moving the ship and when you want it to be adrift, set simulate physics back to on again?

Or you could avoid the issue entirely by giving your ship a Floating Pawn Movement component. That way it can simulate physics and also take movement input at the same time.

Hey Dave,

I’m marking this post as resolved for tracking purposes. I understand that you may be busy with the holidays, so if you would like to keep investigating the issue just comment here to reopen the post.

Cheers,

TJ