Hi guys,
This is what I’m trying to achieve: I want a mesh (a sphere at the moment) that overlaps with anything and applies a force onto that anything, that has always the same direction. The magnitude should be determined by where that something is in the sphere (right now I would simply scale the force with the X coordinate). I thought that I would be able to get that data like this (supposing there is only one component overlapping with my sphere, I would of course check for this normally):
sphere->GetOverlapInfos()[0].OverlapInfo
This returns a FHitResult. I don’t know that class very well, but there are a couple of vectors in it, so I thought I’d figure it out. However: They are all (0,0,0), always. Is this a bug? Everything besides Time (= 1.0), Item (= -1) Actor and Component (which are correct) seems to be defaulted to 0 (or equivalent) in the FHitResult.
I had a strange occurence while debugging (optimized) code, that the vector I assign the ImpactNormal to would contain a sensible value BEFORE I assign the ImpactNormal to it. It would have correspondet to the overlap location in World Space (I think, might be wrong here). Debugging the same bit of code with “DebugGame Editor” settings however does not yield that. I think I might just have been “lucky” and my variable occupied the same storage as a vector before it. Because if that was not the case, then the OverlapInfo I inspected would also have to be “wrong” and I think that’s highly unlikely.
Now: I am doing this right? What I effectively want is some coordinate that is the point of overlapping. I am aware that this by itsself is not really a thing, since the meshes do not overlap in one point, but in a whole volume, so I don’t even exactly now what point I’m looking for. I hoped as I looked at the datastructures I would understand the approach the engine takes to such a representation.
I hope one of you can help me here,