Hit result under cursor for object - just not suitable for what Im trying to achive?

Hi there!

I try using the “Hit result under cursor for object” to easily filter areas where spawning of items is allowed. Like this Wall for example which should only be allowed on terrain, not on the ore.

I thought the “Hit result under cursor for object” would work kinda like a line trace so if other objects are on top of the terrain the hit would be false.
But thats not in the case, even tho all the collisions are setup accordingly.
So currently it will always hit the terrain, independently on how I setup the collision settings of the ore.

Now I wonder, is this just the nature of “Hit result under cursor for object” and do I need to use an alternative way or are my collisions settings still messed up and this should actually work? :smiley:

Appreciate your input, thanks
Sven

You use some grid system, calculate that brown rock position (in grid coordinates) then check what is there.

Just to clarify, is your answer: Yes the nature of “Hit result under cursor for object” is not suited for things that stack on each other and I should use an alternative way (for example using my grid system)

Or is your answer, I dont know about the hit under cursor but here is a different approach?

It looks for specific Object Types, ignoring everything else. This type:

If you’re looking for valid ground to build, it will ignore the ore. But that’s not what you want… We don’t want to ignore it. We do want to detect it so we can find out whether it’s in the way.

If you wanted to use Object Types to filter:

Were we to detect something other than Valid Ground type to build on, we can’t proceed.


It’s easier to check what we’re hitting rather than go through every possible type that we do not want to hit.

1 Like

I don’t know if you know that you can create your own channels and presents including trace.
I use MouseProp Trace Channel which makes the mouse only find objects with the collision present PropMouse.

Lovely, a perfect answer :slight_smile:

If you’re looking for valid ground to build, it will ignore the ore. But that’s not what you want… We don’t want to ignore it. We do want to detect it so we can find out whether it’s in the way.

I indeed completely messed this up in my mind. Thanks for bringing me back on track :slight_smile: