My apologies if this is in wrong spot, but I wasn’t sure if this was a known bug or simply a newbie not setting up my sprite collision geometry or collision parameters properly. Anyway here goes …
This is what I see when running my game. white guy is my player blueprint (BP_Player). blueprint contains a sprite (SPR_Player) with collision hit events and collision overlap events enabled and collision set to pawn. yellow guy is an enemy blueprint (BP_Enemy) that has collision hit events and collision overlap events enabled but with collision set to WorldDynamic preset (everything is blocked).
Here is collision for SPR_Player sprite …
… and here is collision for SPR_Enemy sprite -
I’m getting collision hits and overlap events in my player blueprint in general, but no in all cases as you can see. I hesitate to say that it may behave almost as if I’m only getting collision within a radius from pivot point of sprite. I say this because if I move my player down vertically a little in game, I will get a collision. Almost like they have to overlap my a certain percentage or something before collision registers? Anyway, I’m just brainstorming and hoping its a setup thing and not a bug as such.
All sprites/blueprints on my level are on zero Y axis as well.
Anyway, for vector-style 2d sprite-based experiment, I’d like to get as much accuracy on collision as possible.
Thanks in advance for help.
Hey ThermalShock,
What types of Blueprints are your BP_Player and BP_Enemy? I’d like to try to reproduce this as accurately as possible. Thanks!
Hey . Thanks for responding man. I’m still a bit of noob, but if I hover over them in content browser they all say they have Blueprint in parenthesis.
Their blueprint types are BPTYPE_Normal. BP_Player blueprint parent class is Pawn and is composed of a [ROOT] PaperSpriteComponent, with a SpringArmComponent, and CameraComponent in Orthographic mode with Ortho Width set to 6000. BP_Enemy parent class is Actor and is simply composed of the [ROOT] PaperSpriteComponent.
I’ve also tried simply having sprite (SPR_Enemy) on level with collision set same way and it won’t generate collision on a partial overlap either.
What’s strange is that if I point nose of my ship at enemy it will generate a collision or if I overlap enough on a drive-by I will also get a collision. So its only when I do a drive-by with a small overlap that I don’t and if I get close to enemy and rotate my player so that pointy bits (fins/wings) rotate around into enemy that I don’t get collision. Seems to point to somekind of radius being using for collision instead of sprites collision geometry, but I’ve no idea of course.
Look forward to hearing more from your experiments. Thanks .
Hey ThermalShock,
Thanks for those details. I was able to reproduce this issue and have created a bug report for developers (UE-4898). I will let you know when I see an update and if I can find a workaround in meantime. Thanks for your report!
Any updates on this ? There is no way I could ship a 2D game without this being fixed. I’m very disappointed this wasn’t addressed in 4.6.0 based on when I submitted it, but I know you guys are busy.
I currently have a level with my ship between walls and my ship gets stuck in wall due to this issue. I really hate to have to go back to bounding box or something since collision will appear to be so imprecise.
Can you at least give me a workaround for my sprite collision shape until this is fixed? Thanks.
Hi ThermalShock,
I’ve emailed developers involved in this bug and asked for an update, if they have one, and any possible workarounds. I will also take a look and see if I can come up with a suitable workaround. Thanks for your patience!
Hi Thermal,
Quick update: I have still not been able to find a suitable workaround for this, but plan for developers is to look into this in near future. I apologize for delay, but I will keep you informed.
Hey . Sorry for delay responding but have to say I’ve been losing faith here with 2D in UE4. I still consider myself a noob here and I’m not really on any timetable, but its been 3 months with several releases, and still no fix? I get impression fault lies with rotation not being involved in collision check somehow. I’ve even seen sprites able to overlap when using bounding box instead. Given that you provide sprite editor, take responsibility in terms of collision mesh, etc., I mean its not unreasonable to expect better. 2D collisions locked to a 2D plane should be pixel perfect. Anyway, I’ll stop rambling here and simply hope this reply serves others in keeping this issue alive. I know you guys are working hard on all issues, so I know this will get fixed. Cheers.
Hi ThermalShock,
I just wanted to let you know that we are looking into this. I realize delay has been rough so thanks for hanging in there. I’m currently trying to narrow down if it’s a bug in UE4 or PhysX. I’ll be sure to keep you posted on progress.
Thanks for detailed instructions
An update on this. We confirmed that this was a bug in PhysX which has now been fixed. We’ve patched this in our version of PhysX and it should be resolved in 4.8
Oh this is great news Ori. My thanks to everyone involved in making this happen. Now of course you know I’m going to ask which quarter you might be targeting for a 4.8 release/preview that includes this fix or maybe include in next preview version for 4.7?
Hi Thermal,
We don’t expect this fix to make it to official 4.7 release or any hotfix for 4.7, though I will of course let you know if I learn otherwise. 4.8 doesn’t have any kind of release date yet, but we’re probably looking at second quarter. plan is to continue using Previews, so you might be able to see it working sooner than that as previews start a good deal in advance of official release.