Using Odin Inspector to change behaviour inspectors

nicmar

New member
Hey, I'm new to Behaviour Designer, and I love it, it was so quick and easy to get it going, once I understood how to set it up! :)

I'm making my own behaviour and I'm modifying the Patrol behaviour of the Movement pack, which is awesome by the way.

There is a List of waypoints, and I'd like it to be reorderable, and usually I can do this with Odin Inspector but it seems to have no effect.
The code looks like this:

C#:
        [ListDrawerSettings(ShowIndexLabels = false, DraggableItems = true, Expanded = true)]
        public SharedGameObjectList waypoints;

Is it because SharedGameObjectList is a custom object, or is the inspector being redrawn ignoring Odin?

Thank you in advance!

-niclas
 
I just realized that there is a similar issue when adding a UnityEvent, I don't get the usual interface for adding events.
And there seems to be a glitch with setting up the Lists, I change the Size, but it doesn't show the items right away, I have to click a few times to make it show up.

Here's what the default list and events looks like. Below is what the event looks like in a regular inspector. I think it's the default, and it's much easier to use than the one shown here.

Thanks in advance! :)

1258

1259
 
Also there seems to be some weird issue with the size of the array when I have two events. When I change one, the other change. It's ok if I only have one event.

But as stated before, this editor is much harder to use, since I have to enter Method Names manually. Can't get it to work. I can assign a gameobject to the target, but I can't choose what component I want to call a method on. Any help here is appreciated :)

The idea is to call an event for every waypoint that is reached, and it would be nice to assign it from the inspector of my behaviour.

Thanks!


1260
 
Ah cool, I'd love to have that as soon as it's ready :)

I just posted on https://forum.unity.com/threads/beh...-unityevents-with-the-debug-inspector.675793/ asking if anyone knows how to fill in the "debug" UnityEvent, since what I did doesn't get called. Do you know how I would do that?

How would you at the moment make stuff happen from inside a task, like when reaching a patrol waypoint? Is there any other smart way other than UnityEvents, like maybe setting a variable that the gameobject reads or something. In this task, the event is for another component on the same gameobject with the behaviour tree.

I guess I would like to call an animator too, and change from idle to walking, etc. How do I handle that, and can I use that somehow to call stuff?

Thanks!
 
How would you at the moment make stuff happen from inside a task, like when reaching a patrol waypoint? Is there any other smart way other than UnityEvents, like maybe setting a variable that the gameobject reads or something. In this task, the event is for another component on the same gameobject with the behaviour tree.
Instead of Unity events you can use standard C# events. You won't be able to assign it within the inspector but it's an elegant way to hand it. You can use FindTask to search for a task: https://opsive.com/support/documentation/behavior-designer/behavior-tree-component/

I guess I would like to call an animator too, and change from idle to walking, etc. How do I handle that, and can I use that somehow to call stuff?
Take a look at this page: https://opsive.com/support/documentation/behavior-designer/syncing-animations/
 
Not yet - still on my list before the next BD update (which will probably be around the time 2019.2 is released).
 
Yeah me too, I've been making other stuff than behaviours in the meantime, but it would surely be nice, since I love odin :) I haven't tried using standard C# events for this though, but I like events for other uses, so maybe it's not that hard :)
 
Same here. I find it difficult to draw properties in unity editor in 2 ways - one for behavior designer, and the other for the rest. I wish we could use the default unity inspector here, it would be awesome.
 
Top