I need my Biplane explode after colliding with any static mesh (more than 1000 static meshes).
Simplest decision is set vehicle health to minimum value 1. But it works only for shooting! Not for collisions… (why??)
Second way I did try is detect speed with Verse and if speed quickly became too low - detect it as time to explode. But this method is not very good for me. Often biplane exploding just in the air. But if I set threshold higher, biplane is not exploding after hit…
Who can help to solve this issue? Please Help…
Can you show your speed detection method ?
Sure, I did not save previous version with delta speed detection. Now I just detect speed and explode if speed too low. It works better than previous method
GetSpeed(FortCharacter: fort_character)<suspends>: void=
set LastPosition = CurrentPosition
Sleep(0.1)
set CurrentPosition = FortCharacter.GetTransform().Translation
set Speed = DistanceXY(CurrentPosition, LastPosition)
Yes I guess it’s an okay method, maybe try increasing the sleep time to 0.5 and multiply your threshold accordingly.
I’ve noticed that some frames (n=0) would return the exact same position as the previous frame (n=-1) so that the next frame (n=1) would return a position that’s 2 times further that the one in between (n=0).
I don’t know if it’s still the case though but increasing the duration would allow to workaround this bug.
If you know other methods instead speed detection feel free to share
This snippet may be of interest to you: Track and emit events when players stand still | Uefn Code Snippet
Thanks for response. Can you please say how can I use this snippet for my case?
Yea, sorry I didn’t really elaborate. Well, it’s only helping you with the hack to the problem of not being able to do something like detect a collision. It’s just doing a similar thing to your plane speed detection but takes into account the elapsed simulation time and also uses squared distance for optimization. For the purposes I’ve used it for it has worked robustly. If you have multiple planes, it also shows the way to use those custom events for that.