News › Forums › Troubleshooting › Help: Following then attacking when close enough
This topic contains 20 replies, has 3 voices, and was last updated by prime 9 months ago.
-
AuthorPosts
-
March 4, 2022 at 5:20 pm #9007
Ok - I’ve got your project now. First problem I ran into - your melee detect node runs forever. The moment spotted != null, the AI will run that node and never move on.
March 4, 2022 at 5:28 pm #9008<behaviortree version="1.1" repeatuntil="" name="basicWanderFollowMecanim"> <parallel tiebreaker="fail" succeed="all" repeatuntil="" name="root" fail="any"> <detect sensor=""visualSensor"" repeatuntil="running" name="detect" entityobjectvariable="spotted" aspectvariable="" aspectobjectvariable="" aspect=""player"" /> <selector usepriorities="False" repeatuntil="" name="selector"> <constraint repeatuntil="" priority="" name="constraint" constraint="spotted != null"> <parallel tiebreaker="fail" succeed="all" repeatuntil="running" name="parallel" fail="any"> <detect sensor=""danceSensor"" repeatuntil="running" name="meleeDetect" entityobjectvariable="dance" aspectvariable="" aspectobjectvariable="" aspect=""player"" /> <selector usepriorities="False" repeatuntil="" name="selector"> <constraint repeatuntil="" priority="" name="constraint" constraint="dance != null"> <parallel tiebreaker="fail" succeed="all" repeatuntil="" name="parallel" fail="any"> <mecparam valueexpression="true" repeatuntil="" parametertype="boolean" parametername="dance" name="mecparam" damptime="0" /> <mecparam valueexpression="0" repeatuntil="" parametertype="float" parametername="speed" name="mecparam" damptime="0" /> </parallel> </constraint> <constraint repeatuntil="" priority="" name="constraint" constraint="dance == null"> <move turnspeed="" repeatuntil="" name="move" movetarget="spotted" movespeed="" facetarget="" closeenoughdistance="" closeenoughangle="" /> </constraint> </selector> </parallel> </constraint> <constraint repeatuntil="" priority="" name="constraint" constraint="spotted == null"> <parallel tiebreaker="fail" succeed="all" repeatuntil="" name="parallel" fail="any"> <waypointpatrol waypointsetvariable=""Waypoint Route"" waypointactiontype="patrol" traversetype="loop" traverseorder="forward" repeatuntil="" pathtargetvariable="" name="waypointpatrol" movetargetvariable="moveTarget"> <move turnspeed="" repeatuntil="" name="move" movetarget="moveTarget" movespeed="" facetarget="" closeenoughdistance="" closeenoughangle="" /> </waypointpatrol> </parallel> </constraint> </selector> </parallel> </behaviortree>
March 4, 2022 at 5:28 pm #9009There’s a version that works. (Emailing it to you as well.)
March 4, 2022 at 5:32 pm #9010Prime,
You are the man thank you very much. I can’t wait to get home from work and try this tonight I will keep you updated thanks again.March 5, 2022 at 11:46 pm #9195Having a little problem importing the xml it comes in fine but when I run it changes back to the way it was before import even if I make changes after it was imported. Once I recreated what you gave me manually it works absolutely PERFECT though. Thank you very much this gives me a great jumping off point to learn a lot. Thanks again for all your time.
March 6, 2022 at 5:23 pm #9272Thanks for reporting the issue with xml. We’ll look into it.
-
AuthorPosts
You must be logged in to reply to this topic.