This topic contains 36 replies, has 7 voices, and was last updated by  prime 2 years ago.

Viewing 7 posts - 31 through 37 (of 37 total)
  • Author
    Posts
  • #6738

    narfi
    Participant

    Thanks for giving me something to try, its still (null) though

    #6739

    narfi
    Participant

    Ok, to make it even simpler i changed the visual detector name to “eyes” incase i was somehow crossing mine and misstyping. - no difference.

    Ok, even simpler, I created a cube and a capsule one with the same AI as the spider and one with the same aspect as the fire.

    The capsule sees the cube but can not see the fire.
    The spider can not see the cube or the fire.

    Therefor I think there is something wrong with both my spiders sensor and the fires aspect. (I read somewhere but cant find it now that it wont work if the mount point is inside the collider. But I thought if you used the main object as the mount point that you didn’t have that issue?

    What is my next step?

    #6742

    narfi
    Participant

    Ok, got it figured out (kind of)

    When I added the visual aspect to the fire it made it a component of the game object Fire.
    When I added it to the cube it added it as a child of the cube and that is what worked.

    I deleted the one from the game object Fire, and added it again and it made it a child this time and is working like it should.

    I now have a tree that looks like this,

    (par) Root
    detect
    (con) constraint
    (par) parallel
    animate
    move
    (con) constraint
    (par) parallel
    animate
    (way) waypointpatrol
    move

    So now using the real spider and real fire,
    If the fire is within visual range the spider moves towards it
    If the fire is not within range the spider (kind of moves on the waypoint path.

    Now the problem is that the spiders aren’t moving very well on the path, and neither animation is working.
    Too tired now, will try again tomorrow, I think im getting close though

    narfi

    #6750

    narfi
    Participant

    Ok, so awake and looking at it again.
    The detect is working, but the behaviors below it do now seem to work properly.
    If it sees fire, it moves smoothly straight towards it just as it should, but does not play the animation.

    If it does not see fire, it follows the paths, but very jerky, every split second it rotates 20 degrees or so and then back to the direction it is going, and also does not play the animation.

    Here is the BT I have setup for it,
    https://drive.google.com/file/d/0B7YSHeel4PnxS1NOcU83SEJ6TVk/edit?usp=sharing

    To test it, I made a copy of the bt and removed the detector and the fire behavior branch, so it is only the animate, waypointpatrol, and move. Using that BT it works properly, it moves to the waypoints and is animated.

    So from what I can tell, either there is an issue with the sensor effecting it (which doesnt seem the case, but maybe it is somehow switching null/spotted really fast so i cant see it or something?) or there is something wrong with the constraint nodes which also doesnt seem the case since you can see the proper constraint branch is lit up, and they are all yellow.

    any ideas?

    thanks

    narfi

    #6756

    prime
    Keymaster

    Your BT is resetting every frame. You can see from the image you posted that the first constraint is failing (it is red.)

    To solve it, use a selector with the constraints as children.

    #6761

    narfi
    Participant

    That did it, thanks

    Just for my understanding though, if they are in parallel, why does it matter if one fails?

    #6762

    prime
    Keymaster

    Your parallel has setting for how it handles failures. Fail on Any or All. Any means the parallel fails if any child fails.

    Generally, however, Parallel nodes do not have any special looping behavior. They won’t restart the child nodes if they fail or succeed. A Parallel is pretty similar to Sequencer or Selector - it just gives all nodes a chance on each frame, rather than one at a time.

Viewing 7 posts - 31 through 37 (of 37 total)

You must be logged in to reply to this topic.