I’ve spawned my pawns into the level, but I can’t click on them. I can click and focus on literally every other actor in the level, just not the pawns.
GetHitResultUnderCursorbyChannel ← doesn’t recognize my pawns
LineTracebyChannel ← doesn’t recognize my pawns
Both of these will go through the pawn and show that I’ve selected the landscape under them or the wall behind them. The LineTrace, when debug is turned on, goes off in a random direction, which makes no sense. My start trace is the camera world location and end trace is the camera’s forward vector multiplied by a float for distance.
Get Hit Result Under Cursor by Channel & Line Trace by Channel mean very little on their own. It’s about what channel is being used.
GetHitResultUnderCursorbyChannel relies on the Visibility channel (by default) and can be adjusted in the Player Controller. Same with the LineTracebyChannel - but you get the choose which channel on the node directly.
The Pawns (whatever they use as colliders) must block that very channel (True by default).
My start trace is the camera world location and end trace is the camera’s forward vector multiplied by a float for distance.
Sounds like you forgot to add the actual world location to the end of trace.
They were both set to Visibility. (The controller and the GetHitResult) I tried to change them to Pawn, but only the controller has this option. The GetHitResult only has Visibility and Camera options.
But either way, if they are both set to Visibility it should work, but it isn’t
No, but it’s not random. I’m thinking it needs to go where the mouse clicks. It’s not. It’s going to go where the camera is pointing. Even so take a look at this:
I’ve created a new collision channel for selecting units. I’ve set that to block in the ParentUnit_BP, but I can’t set it on the GetHitResultUnderCursor. How do I get that node to be able to use that channel?
Nope. I set the PlayerContoller default click trace channel to UnitSelect (<–my channel). The ParentUnit is set to block that channel, but still the only two options I get on the GetHitResultUnderCursor are Visibility and Camera. I need to get this node to use that channel.