Using Ultra Dynamic Sky. How to line trace toward the suns direction or angle?

Does anyone know how to line trace at the angle from character to the sun/lights direction while using the ultra dynamic sky plugin? I am trying to do this to detect if the player is in shadows or not for stealth gameplay with shadows. I am struggling to figure the method in blueprints to use, and what parts of ultra dynamic sky to use…

I have tried using a cast to the first UDS in the scene and getting the sun component from it, but when I try to trace to it from actor, it just goes diagonally downwards to the floor. I believe towards the world 0,0,0 position or center it rotates around maybe? I cant get it to just send an angle in the direction of the light… Would REALLY appreciate it, especially if you would be so kind as to show blueprints so I can better understand/visualize/learn. Thank you so much!!!

Nvm, ty for the attempt idk what it was. hehe.

Turns out that you go to the sun and use the forward vector of it. I was being dumb and trying to get the angle values because of what I heard from someone else, and that just screwed it up. Just get forward of the sun and multiply it by a number for the distance to trace down that direction and add it s vector to the location of your character. Vector related math confuses the crap out of me. lol… Feel dumb, but oh well… xD

1 Like

I did this before ( long time ago ), and I’m sure I could get the world location of the sun disc. But apparently not :smiley:

Yes, using the forward ( or reverse ) vector of the light direction will do it, too.

1 Like