x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Static mesh collision going through walls at high velocity

Hello people!

I've got a top down space sim game I'm working on which is all physics based and I'm having some issues with collision.

The movement of the ship is controlled by set rotation and add force on a small collision sphere at the center of the ship.

Is it possible to add a custom shaped collision component to an actor or does anyone know how to stop my static mesh collision from penetrating through walls when rotated and moving at high velocity?

Original setup: Issue penetration at high velocity.

I'm using the skeletal mesh for collision because it looks very cool when the mesh contacted with surfaces and bounced off with the correct rotation.

CCD is on.

Collision not working, rotation working

Unfortunately when moving at high speeds (Velocity of 3k+) the static mesh's collision isn't enough to stop it penetrating through objects when the ship is rotated to the side.

I've tried building a few custom collisions for the mesh and none work (If anyone knows how the mesh interacts with the scene e.g. Vertex normals please tell me as I can try other collision meshes.

I can fix the issue by turning off the collision on the static mesh and turning on collision on the sphere but then I get no rotation from impacting the wall.

Collision Working Rotation not working

I think it might have something to do with the rotation on the static mesh.

It will very frequently go through collision when rotated even when not moving at high speed

Any help or suggestions are appreciated.

The only solution I can think of is getting the hit event checking to see if it hit a wall, and then adding a random rotation force based off the angle of impact from the wall but that would never give me an accurate result.

Also If I turn collision on for both the ball and the mesh it will go through the wall and never seem to check the ball's collision which is super frustrating.

Thank you! P.s. I tried turning on sub steeping for physics and that helped partially (When I was using the static meshes collision) but it still would penetrate through.

Product Version: UE 4.9
Tags:
more ▼

asked Jan 14 '16 at 09:47 AM in Everything Else

avatar image

Danny Blank
68 7 7 33

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Try turning on continuous collision detection. There's a "Use CCD" checkbox in the advanced collision settings for your mesh component.

more ▼

answered Jan 14 '16 at 03:23 PM

avatar image

-Ross
186 5 9 13

avatar image Danny Blank Jan 14 '16 at 05:57 PM

I've tried turning that on and nothing changes it still penetrates through :/ Unreal doesn't seem to do anything different if you have 2 collisions running at the same time.

avatar image -Ross Jan 14 '16 at 06:47 PM

Oh, I'm an idiot. I didn't read your post very well did I, sorry. Two things stand out: 1. You have Auto Weld on, so the static mesh should be inheriting it's physical properties from the sphere (though it doesn't seem to be). and 2. you're setting rotation rather than using a torque, so it could be rotating into an object.

avatar image Danny Blank Jan 14 '16 at 11:12 PM

Nah I did a Ninja edit, well the thing penetrates walls even if it's not rotated so long as it's going fast enough so the torque thing doesn't really matter.

The auto weld thing is effecting it, it looks like it's a decent avenue of research. I did manage to kind of fix it by cranking the sub steeping into turbo mode with max delta time of 0.1 and 16 max substeps now it will only penetrate if the velocity is >10k which it never will be because that's much too fast. So it's kind of a fix but will probably trash my performance in the long run... :(

I'd still like to know why the sphere collision never penetrates without substepping where as my static mesh does, also I'd love to know why the collision is worse when both the sphere and the static mesh collision are used, maybe it calculates one surface at a time or the collision components have a special property to them that allow them to be updated with higher priority (Which is why I want to know if you can create your own custom collision component)

avatar image -Ross Jan 16 '16 at 12:41 AM

Aha. Hmm. It's strange that CCD doesn't fix it. Have you tried changing the collision mesh for your static mesh just to see if any other shapes work? And your mesh isn't really small or anything? (less than 10-ish) Could you upload your project so I can test it myself? (there's a "Zip Up Project" option in the packaging menu in case you didn't know.) I have a physics-based top down space project myself and I've never had collision issues.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Right so seeming as no one else has answered and I needed this fixed I came up with my own solution.

I'm not really happy about it because I use an event tick, but it solves my problem without turning on physics sub steeping onto something ridiculously low and there fore expensive.

I'm not sure which of the two is more costly an event tick or sub stepping if anyone knows how to measure this I'd appreciate it.

My solution is to perform a line trace to look ahead of the actor and if were going fast enough to penetrate through a wall then slow down to a speed that wont penetrate just before hitting the wall, which then in turn allows unreal collision detection to catch up

alt text

Hope this helps someone else :)

more ▼

answered Jan 15 '16 at 11:06 PM

avatar image

Danny Blank
68 7 7 33

avatar image Davision Jan 16 '16 at 03:13 PM

Interesting solution. I'm having problems with ragdoll bones getting stuck behind walls that they penetrated and not sure yet what to do about it. Set Physics Linear Velocity is pretty expensive for every tick. You should be able to get the same working with using Add Force instead

avatar image ColdSteel48 Nov 25 '17 at 06:54 PM

That's pretty raw and not optimized solution indeed - but I like the IDEA And will definitely use the idea. However the implementation could be deeply optimized :-)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I can't point you to a checkbox that will solve everything, but I think my solution will be faster than what you're doing now.

Start with a collision shape that is slightly larger than your ship. Then, on tick, add (velocity * elapsedSeconds) to the dimension(s) of the collision shape. That way, the faster you're going, the larger the collision shape around the ship, and thus the earlier the collision will be detected. I take the (velocity*seconds) value and multiply it by some small amount (like 4) to add a little buffer room.

The easiest thing is to grow all three dimensions by the length of the velocity vector. That would be good for an initial test, but with some math you can grow the shape along individual axes based on the actor's rotation and velocity along that axis.

On collision shapes, the only way to not use a standard collision shape is to use 'complex' collision. I've never seen that work right though and it sucks up CPU like an infinite loop.

more ▼

answered Jun 06 '17 at 08:19 PM

avatar image

Jin_VE
4.4k 32 77 41

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question