![]() ![]() They are identical, except for having different 2D sprites. Same tags, same layers, same values, same colliders, etc. The A* grid is the same, the obstacle is the same, the seeker is the same, the target is the same. I’ve spent at least an hour looking at the differences between the seekers in the first scene and the seekers in the second scene, and I can find NO differences whatsoever. ![]() If the obstacle is placed on top of the seeker, the seeker remains inside of the obstacle. However, if the seeker’s target is inside of the obstacle, the seeker just travels in a straight line to the target, ignoring the obstacle. Normally, the seeker pathfinds around the obstacle. The graph updates when I move the obstacle. I have 1 seeker and 1 dynamic grid obstacle. Perfect behavior! Exactly what I want! However… If the obstacle is placed on top of the seekers, the seekers move outside of the obstacle’s radius. If their target is inside of the obstacle, the seekers move to the nearest walkable node. The 5 seekers all update their paths and move around the obstacle to reach their target. I can move the obstacle around, and watch the graph update accordingly. I have 5 seekers and 1 dynamic grid obstacle. In one scene, everything is working perfectly. But with the GUI.I’m using the “Seeker” script, “AIPath” script, and “Dynamic Grid Obstacle” script that come with the plugin. In any other system I'd be able to create a button class to use as a toggle, and code unique information into each instance of the toggle and call one function to sort out which toggle was turned on or off. It doesn't seem possible with GUI Toggles to dynamically generate the needed If statements in the OnGUI handler, or what? I need a tip from someone here. ![]() And I want to make this dynamic - you can alter the number of doors. there are 72 buttons needed just in the example. So, now I want to replace these with usable Toggle buttons, and thus the problem: dealing with an IF ELSE statement for each button - these buttons are generated in a loop. Starting from zero knowledge of inspector layouts and tools I was able to code up this grid of EditorGUI.PropertyField boolean elements in a day - but all they do is display the current state of the data structure. (This rule is to make it easy once I hook this up to the path-finding code I have yet to implement.} Therefore door_1's exit is not allowed to connect to door_0's entrance. For example in the image below, you see door_0's exit is connected door_1's entrance. once one door connects its exit to another door's entrance, the reverse connection is not allowed. Once I had completed that part of the system, I needed some way of connecting one room to another and, to make it easy on my path-finding algorithm, marking room exits and entrances in my data structure.Ģ. Thus far I have a neat system that allows me to drag room gameobjects around on a grid of nodes (you see in the image) and identify room doors (blue nodes), and walkable and unwalkable nodes (green and red), all automatically. I'm doing a level design tool in the Scene View, arranging rooms on a grid and then (coming soon) dynamic rectilinear path generation (using A*) between doors of selected rooms (note the black path drawn over the screen shot) and finally baked into sidewalk meshes. Hey All! I'm stuck here with how to handle the logic connecting a a grid of toggle buttons in a Custom Editor inspector. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |