When i take my ingame unit and tell him to go to a place, he does it then as default enum is set to “wait” he waits (idles, plays idle animation) but when I tell that unit to go chop tree he only walks up to it and then he idles. The problem is the enum state should change to “collect” (which fires the task associated with it which collects wood and kills tree when done) but it doesnt… I mean when I print the enum value on screen via “print string” and attaching enum to it, it shows the current enum is set to “collect” but the unit idles and the task is never run…
Im new to unreal and I’ve been following tutorial (even though its for ue4 99% of the code works fine) so please be patient with me
here is the blueprint where enum should be changed (it gets fired when player presses RMB on tree with unit selected)
I have been trying to figure out what the hell is wrong for the past few days and cant come up with any solution… here is the link to the tutorial Im following in case that matters (with the part where the whole behaviour tree is being made):
To get the ball rolling and just to double check, is your wait set to looping? That could possibly get you stuck. Have you also double checked your key values to make sure wait was not accidentally set as collect as well?
I dont follow what do you mean if its set to looking? And I dont think its possible for the “wait” to be accidentally set to “collect” as it would fire the task every once in a while, no? And as shown in the first picture I uploaded thats the only place I change the enum. Enum also only changes back to “wait” in behaviour tree when BT runs through the second selector (see third image)
here is a pic with enum blueprint where the three states are set
Apologies, what I meant is, is your behavior/state animation set to looping? Simple parallel nodes can also sometimes get stuck if you don’t have a fail/execute condition. Here is an example of that happening:
We can definitely figure out what is happening here.
I dont think its animations fault though, I have messed around with it many times and I probably made every possible combination of tick boxes…
Here is the latest setup:
here i have temporarly changed the enum key value to “collect” for both “wait” and “collect” nodes, did not help… enum is not changing from “wait” (also all animations have no boxes ticked like in the picture above except for “collect” node which doesnt matter since it is never fired anyway)
i think I’m gonna give it one more shot and delete behaviour tree, task and enum BP and redo it all again as I’m on a deadline (its for college) and with normal job I cant waste that much time
If the issue appears again I’m gonna have to find another way of doing that… If you have a YT tutorial for something like this that would be much appreciated
Found it… Found the problem… There was 1 character long space in “make litereal name” node… I cannot believe how long it took to find and fix the issue… Thanks for help