edited November 2016 in ORK Scripting
I'm trying to create a script that casts a ray to a combatant's currently selected target and can't figure out how to get that transform. I'm trying to make sure the combatant can actually see the target.

p.s. will the 2.9 raycast update include this? Or is that already in there? I can't seem to figure out how to make it check for obstacles for a recast attack and figure making my own simple script that sets a variable would probably be the most direct way.

Thanks!
Post edited by drewradley on
  • edited November 2016
    That's currently not possible and not part of the raycast target selection coming in ORK 2.9.0 - can you describe what you want to do?

    E.g. when should this happen, while selecting a target with the battle menu (i.e. as a target requirement), after selecting the target, ...?
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited November 2016
    Anytime before the attack is calculated really. I currently use battle events to send a message to the target which then sends a message to the player along with its transform. The player then raycasts to the target and sets a status value called "LoS" (Line of Sight) to 1 if it sees and 0 if it doesn't and then use LoS to determine if the attack can hit or not.
    Seems rather convoluted to me, but it works - sort of. I'm just figuring if there is a way to get the target already, I can skip part of it. What would be better is if I could just block selecting targets that the combatant can't see, but I'll settle for just making it not. Might even make an ability to allow you to target through cover/walls.
    Post edited by drewradley on
  • Currently you could do that in the battle event of the ability - similar to your current setup, but after doing the raycast to check if the enemy is visible, just don't procede with the event and don't do the calculation.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • That's pretty much what I am doing, I was just looking for an easier way to get the selected target. No big deal. My way works fine. Just seems to use a lot of extra steps to get the target combatant.
Sign In or Register to comment.