Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

18
What makes Unreal collision so unstable and what can I do to mitigate it?
Post Body

I am under a year total using UE4 and really confused about collision in Unreal. Imagine a car and the spring that propels a car upwards. Simple math between a spring and body on which it acts (-kt) can be applied and increased as the body of the car impact the spring more. This allows a simulation of a car with suspension.

So I setup a simple collider (overlap all) for the body of the car.. a box, and I set it above a simple spring. When the box overlaps the spring, the spring will push back and push the car higher. I know this is a little over engineering, but in theory it should work. The spring is also set to overlap, but the collision profiles make no difference to the question.

The overlap event fires, I receive my callback, hunky dory, and on we go. But hey, it stopped firing. I checked that in 3 days ago... why doesn't it fire anymore? Maybe it's a compile problem.. rebuild. No result. Restart Unreal, no result. Restart computer, still doesn't fire. Rebuild it using the same C code... works fine.

Whatever, I have other fish to fry. Monday rolls around... now it's working about 70% of the time. Restart (Alt-P) and it works. It works about 70% of the time and does not fire the event the other 30%.

Is there some setting to make it always work? Intersection of colliders is a solved problem and an easy one in general... why does this fail so often?

Is C support not good?

For the record, I added debug print statements and debug draws for the collision and about 30% of the time, it just doesn't work. Do I need to write my own collision system?

EDIT: I have created a link to a copy of the project. The project is called "Leveller". THE ONLY FILE THAT IS TRULY RELEVANT IS SPRING.CPP. Look at the function:

void USpring::OnOverlapBegin(...)

The rest is a lot of other test code. I spent a fair amount of time making sure this works.

https://www.dropbox.com/s/fb627lw0g1e9eak/BalanceBeam.rar?dl=0

Again, about 30% of the time, the Overlap event never fires. If it fires for you, then add a few spaces or an empty function to Spring.cpp, recompile, and voila... no worky. If it doesn't work, getting it to work again can be tough. Try rebuilding (ctrl-shift-B) and running, cleaning sometimes works, compiling from the UE4 compile button in the UI sometimes helps, shutting down Unreal sometimes works, rebooting never works, or adding more code sometimes works.. just a new random function or two.

Author
Account Strength
100%
Account Age
16 years
Verified Email
Yes
Verified Flair
No
Total Karma
22,551
Link Karma
530
Comment Karma
21,963
Profile updated: 3 days ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
7 years ago