Greetings Epic Community,
Today I bring a new issue that I can’t seem to work around. Here’s the detailed overview or scroll down to see the shortened version.
Detailed Version
So, my pick-up system is having this issue that when I throw the object or even just drop it, it behaves like blocking despite being set up to only block the player once out of the player’s hitbox. Below I’ll provide the code for how it works on both the player end and item end.
In this photo, (I know that it’s not very efficient) I have the item end of things. Which I feel like this should work as though Can Physics Collide is a static variable that determines if you can walk through the object or if you should collide with it.
Now, another aspect of this issue is that the overlap doesn’t really seem to take effect. Which is the biggest issue. E.g. I throw it against the ground near my feet and it tries to escape my hitbox. I can assure you that the pawn is set to be a pawn to confirm and when I do a test with the same collision settings against anything else, it doesn’t have this issue. It’s exclusive to when I have code controlling it in any manner.
Below is a picture of the player side (note that I can confirm that the release and grab code doesn’t interfere with the hitbox):
The code above is called on tick. (Not efficient, I know, but still shouldn’t cause the issue).
If you need any more code snippets let me know!
Short Story
My pick-up system seems to be broken due to the overlap collision being registered as block by the system despite being very obviously overlap when I read the values in PIE.
I can see how this would be frustrating, as it should work.
What I would do is try a different approach entirely-
You could try to use OnComponentEndOverlap on the item, and check OtherActor vs PlayerCharacter’s class. If class ==, then activate blocking collision.
I looked through that code and everything seems like there weren’t any simple mistakes or anything, but I didn’t see any collision changing.
Another thing you may need to look into is your player’s collision- both your collision capsule AND your skeletal mesh if it has collision enabled in any way.
That said, Ignore beats Overlap beats Block. If your player is set to overlap the meat and the meat is set to block it, OVERLAP beats Block, so it is acting as though both are set to block-
Edit: though, now that I think about it, the physics assets may not care about that collision setting at all. Because the physics asset isn’t the collider. And this seems to be a physics asset collision thing.
It looks like you’re setting the simulate physics bool to TRUE on the actor the moment you drop it. Maybe take that out, and then on ActorEndOverlap (==player character = True branch) Set Simulate Physics == True?
Thanks for getting back to me! So yes, the collision on the skeletal mesh is set to off, and the collision is being set in the item’s code (the boolean Held determines this). I made a few modifications last night and noticed that even when I delay it, it does in fact set the collision later but it’s almost like the meat is interacting with something in the player that doesn’t exist.
This issue also extends to when I throw it while running, it seemingly gets caught in the hitbox despite still being set to overlap.
EDIT: The simulate physics must switched back immediately so that it may throw even through the player until it leaves its hitbox which if all goes well would re-enable the collision.
If you’re not acquainted with physics assets, I can see how it would seem like there’s nothing there, because they don’t show up on the blueprint- they’re assigned to the skeletal mesh!
As seen here on the Infinity blade free weapon assets:
These are not visible on the blueprint, so that’s the invisible component you’re running into. Unfortunately there isn’t much you can do to it directly, as it is not really something that needs modification at runtime- that’s what all of the physics settings do, this is just a visual representation of the physics.
It’s set to block all but the pawn, and if ignore trumps overlap, overlap trumps block. Then shouldn’t it overlap the player? As though it’s set to overlap on the food side.
EDIT: Other than what you saw in the code snippets above, no. The collision is not set anywhere else.
Hey @MiscellaneousMyth!
Don’t worry, I didn’t forget about you, I was just out for the weekend! Sorry about that!
Yes, you are correct about that, depending on the collision profile of the food and what it is set to on the player side. Would you mind showing:
The player character’s component list
Anything that has a collider on the player’s component list’s collision list and profile
The food’s collider component’s collision list and profile?
I’m hoping that cross comparing will show the issue- when you lay them out side by side it’s usually easier than flipping from one to the other to prevent confusion!
Get that for us and let’s see if anything new shows itself!
EDIT:
I forgot to mention that above it’s set to physics body to test, forgot to swap it back but it has the same effect even without changing the code.
It does in fact directly inherit from the default character and it does have collision settings though it’s set to off completely. I’m trying to rebuild the system today from the ground up. I’ll let you kow how it goes.
Well, I got a similar effect, but I have more debugging and it’s that held is repeated swapping between held and not held. Kind of strange behavior considering the only time it’s set is when I call new hold and end hold (which are only called once each according to the debugger).
I’m thinking I have gremlins in my project…
Where are you calling those? It may have to do with input!
If you’re using EnhancedInput make sure you’re using “Start” if it’s a one and done.
Definitely want to make sure those functions are off tick, I know that’s an easy one but whole projects are shut down by one bool sometimes, even experts make mistakes at the lowest level (in fact that’s where they’re most likely to happen)!
Sorry for my delay, I’ve working on a car and doing some camping. I think for now I may just break off this project and come back to it later on. I appreciate your assistance, and I did check the input, it is set up properly.