"spawn actor from class" affecting "get hit result under cursor by channel"
I have a simple blueprint flow: get hit result under cursor by channel > break hit result > make transform > spawn actor from class
The actor does not spawn at the expected location. Instead, the hit result gets offset by the dimensions of the actor. I understand that I'm spawning the actor under the cursor, but did not expect the hit result to be affected by it. It was already calculated once, so why is it being calculated again?
When testing in Visibility channel, the location on Break Hit Result should be returning the location on the surface of the hit object. If the spawned object is 100 uu in Z axis, half of the object should clip. Is this not the behaviour you're experiencing?
Perhaps, the collision is getting in the way and the the newly spawned object is being offset to account for that. It can be adjusted:
Another reason for the behaviour you're seeing might the manual offset in the actor's components. Worth double checking, too.
If this does not help, would you mind attaching a screenshot of the current result vs the expected one.
Below is the correct behaviour, I placed the cursor close to the edge and draw a debug sphere:
If I wanted the sphere to sit directly on the surface, I'd have to offset its Z by half.
Follow this question
Once you sign in you will be able to subscribe for any updates here