Announcement

Collapse
No announcement yet.

Get Random Point in Navigable Radius (Can this be forced into a cone?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    The easy way would be to get a random point in navigable radius, test if it's in your cone by using the dot product and the bik's forward vector. If it's not, repeat the process.

    If your cone is really small this will be inefficient though.

    Leave a comment:


  • replied
    Originally posted by Name368 View Post
    Its probably possible...
    There is node "random unit vector in cone with yaw and pitch"
    Output of this node is max 1 1 1, its usually used for shotguns...
    So, you can multiply this value from 1 to 1000 so you can get point in shotgun muzzle, or 500 units away from muzzle but still in cone... if you want only "2d cone" use pitch 1 and yaw 10 for example... i hope you understand, if not let me know and i will make bp for this and print screen here.
    Sorry about the delayed reply, and thank you for your answer. This sounds like it would work, but I don't think it would consider the NavMesh would it? the main reason I was trying to find a method that used the Random Point In Navigable Radius node was that it factored the traversable space for the AI. I will try using this method, but I get the feeling it might produced invalid destinations for my characters.

    Leave a comment:


  • replied
    Originally posted by Benni.Lodge View Post
    Is there a way for me to use the Get Random Point In Navigable Radius node and have it only check within a cone? In my game the AIs are motorbikes who move forwards, but I was hoping to get some variation within their paths whilst still using pathfinding.

    Do I need to add a filter class or some NavData? I'm not a programmer so I'm not sure how I'd go about solving this. I spent ages trying to clamp and flip the result into a valid positive x-axis but then i realised that this makes the "Navigable point" part invalid.
    Its probably possible...
    There is node "random unit vector in cone with yaw and pitch"
    Output of this node is max 1 1 1, its usually used for shotguns...
    So, you can multiply this value from 1 to 1000 so you can get point in shotgun muzzle, or 500 units away from muzzle but still in cone... if you want only "2d cone" use pitch 1 and yaw 10 for example... i hope you understand, if not let me know and i will make bp for this and print screen here.

    Leave a comment:


  • Get Random Point in Navigable Radius (Can this be forced into a cone?)

    Is there a way for me to use the Get Random Point In Navigable Radius node and have it only check within a cone? In my game the AIs are motorbikes who move forwards, but I was hoping to get some variation within their paths whilst still using pathfinding.

    Do I need to add a filter class or some NavData? I'm not a programmer so I'm not sure how I'd go about solving this. I spent ages trying to clamp and flip the result into a valid positive x-axis but then i realised that this makes the "Navigable point" part invalid.
Working...
X