Hi, ![]()
I’ve done a fair bit of asking questions around here and tons of lurking. ![]()
I’d like to offer something back in the form of a Point and Click Selection, Movement and Avoidance system. The scripts are below along with instructions. I’ve tried to mark up my own custom spots so you can edit them out if you want to.
I’m hoping that:
A. Someone finds this useful.
B. Others far more experienced than I, could suggest better ways/more efficient ways/offer comments on the way I’m doing what I’m doing.
I’ll describe the system and also attach a basic project.
In my own top sekrit project, every mobile object on the field has a copy of the same script attached. The actual script and its uses are far more in depth and outside of the movement/selection section. Each object has a character controller AND a box collider.
There is a ground plane/ terrain/ floor, whatever, with a mesh collider. It also has a very simple script telling the GameManager that the mouse is over it. This is used to prevent GUI clickthroughs for movement. The character controller glides over the surface following ups and downs.
Empty GO with a GameManager script attached to handle selections and selection particles.
A prefab particle object to show who is selected and destination. The destination version of this also gets a box collider added in script.
Objects can move independently of each other and each will avoid the other.
Import the package into an empty standard project. Scene already set up with the system functioning and two mobile objects you can control and one static obstacle.
Please check it out. Please feel free to offer up any suggestions/comments/criticism, etc.
I am a VERY novice programmer, bear that in mind! All comments are greatly appreciated.
Jason
EDIT: Package back up, problem fixed! ![]()
EDIT: version 0-1-1 available. Changed destination code to allow movers to ignore a destination that was not their own. Previously, movers would treat other movers’ destination colliders as obstacles.
176318–6303–$pointclickmoveselectavoidsystem_v0_1_1_418.unitypackage (1.08 MB)