It’s very short code and nothing complex, I went over this again and again and couldn’t find a difference from the instructor code, what am I missing here?
Thanks in advance
Could you try rebuilding by closing Unreal then deleting the Binaries and Intermediate folders?
If that doesn’t work would you mind sending me your project using the following link?
I am also using UE5 and having the same problem. I’ve tried all your solutions here to no avail. I’ll be uploading my project zip to the link you provided here in a minute.
Alright, after playing around with it more I found the issue. You must turn on “generates hit events” for the static mesh component and turn OFF generate overlap events. Apparently now (at least in some cases) in UE5 they are mutually exclusive.
An object can have both types of events but it isn’t recommended according to the documentation.
In general, overlap events are useful for detecting when an object enters or exits invisible volumes (e.g. triggers) whereas hit events are more useful for detecting collisions between objects that essentially ‘block’ each other (a projectile colliding with a wall, for example). So while technically not mutually exclusive, they generally have different uses.
That is option is only for when simulating physics. You should disable simulate physics and then move your spawn point further away as it was too close to the mesh on both tank and turret pawns preventing it from moving.
@DanM If you’re referring to the ‘Simulation Generates Hit Events’ option, that’s actually not true - an object can absolutely generate hit events with the ‘Simulate Physics’ option disabled, albeit both the name of the option and the tooltip are a bit misleading. Also from the second screenshot it appears that ‘Simulate Physics’ is already disabled.
I assume your second comment about the spawn point being too close to the tank & turret is in reference to the actual project that was uploaded, which I don’t have access to, but that sounds correct based on similar issues I’ve seen in the past.
I think you misunderstand. That option is only for “Simulate Physics”; however that doesn’t imply that you can’t have hit events without “Simulate Physics” otherwise that would mean with my suggested fix above it wouldn’t actually fix the issue.
That’s kind of the whole point of the bool, hit events are disabled if you simulate physics unless you opt into it by checking that.
Yep, got it. I was a bit confused because you said to disable ‘Simulate Physics’ but it appeared that it already was disabled based on the screenshot. I also thought you were implying that hit events were only generated if ‘Simulate Physics’ was enabled, which you clarified.
And yes, to be fair, I didn’t realize that enabling ‘Simulate Physics’ actually disabled hit events unless you opt-in with the flag as you indicated and also as stated in the documentation.