Wandering Cubes

I’m trying to create a very basic agent simulation and have run into some trouble. I have attached a package with all of the scripts and assetts I’m using (except Standard Assets as I assume you’ll already have those).

What I’m trying to do is give three breeds of cubes slightly different wander and seek behavior. The steering is crude at best, but don’t worry about that.

In addition to the wandering, I have given each cube the chance to be ‘interested’ or ‘interesting’, or neither or both. This is in a script called ‘interest’.

Ideally, if a cube collides with another cube I want it to check if the ‘interest’ script attached to the cube it collided with has the ‘interesting’ variable true. It also needs to check if the ‘interested’ variable in its own ‘interest’ script is true. If both conditions are true, then the ‘interested’ cube will point at the ‘interesting’ cube and then follow it.

Right now, none of that happens and I’m a bit stuck.

Any advice would be extremely appreciated.

– Anthony

106416–4068–$wanderingcubes_190.unitypackage (26.6 KB)

Perhaps post the code where you think it goes wrong. Also, describe exactly the behavior you’re seeing (that you shouldn’t be seeing). Both might be quicker means to finding a solution.

Also, if sharing a package, please put your exported assets in their own directory before creating the package. Makes a mess of the importing users Project folder otherwise.

Are you looking for advice on how to proceed or debugging of your code? Generally more information would be helpful - I doubt that a lot of people here has so much spare time that they’ll just shuffle through your project and discover that information on their own.

Emil and Casemon,
You’re both right, this was not an extremely helpful request for help, and the package I uploaded was a bit hastily put together.

Many apologies for that and thanks for responding.

I was in a bit of a state with this project. So much so that I threw it out and started over again. And this time, I approached it from a different point of view and it worked very well.

Doubtless I’ll be asking more questions in the forums in the future, but I’ll keep your advice in mind and be a little more tidy and specific.

BTW, Emil, I’m too much of a noob to coding to actually make use of your Behave system, sadly. It seems like an excellent, excellent system. I went through your tutorial and got the simple behavior tree up and running, but I’m not sure what to do with it from there? It’s not as simple as just dragging and dropping individually scripted behaviors into the tree, is it?

When I get a little more experienced I’ll come back to it, as it is such a promising tool. Thanks for the developing it (and the Path system too…)

– Anthony

Arges from the community has started a series of unity tutorials and currently he is focusing in tutorials for the Behave project. As he puts it: “you probably saw the example and were left thinking that’s nice – but what do I do now?”.

You should check it out.
http://www.arges-systems.com/

Hi AgryAnt,

Thanks for the plug. Indeed, there’s a couple tutorials there, one of which deals precisely with wandering cubes of sorts (they’re chasing after a ball). It should give you a good idea of how to set up a running project with behavior trees.