So Hello Everyone,
here is my Topic. I want to build some kind of "contruction-kit" wich runs on pc and touch devices.
I undertand scripting and Playmaker but as always.... still very new to it.
There schould be graphical representaions like an "Icon" of the Parts on the screen. As soon as you click/touch the Icon, the prefab will spawn
(Create Object) the Prefab and lock on the mouse / finger as long as youre dragging it around. The User should drag it to the assumed correct place and if it is the correct, the GameObject will attach to the desired Position (like a 3D Puzzle). So you should be able to build e.g. a Castle.
The whole Scene should be viewble from a 180° view and be turnable.
So I started with the Ground giving it a collider with a "Mouse Drag" Script. The spawnable Prefab GameObject like the towers had a "Drag on Mouse Down" Script attached to it. As soon as the desired Position is reached
(Trigger Event) a
move Towards Action is launched and on
Mouse Button Up the Prfab snaps to the Collider. If no Collision is detected, the Prefab shall return to its Icon and we're at the start again.
So my Problems are:
1. How to check the Collisions if the Scene is turned? If i got the GameObject attached to my Mouse and it intersects optically but they do not touch...
Case: the GamObject and the Collider are on one raycast line from the POV but the Colliders do not intersect.)
2. Whats the best way, to make a correct Order for the Gameobjects to be placed at the specific Locations. E.g.: You shouldnt be able to place a tower in the Air and it stays there, while the basement is not even in Place. Should I store the Objects with an Array?
3. How to make a Reset Button best? Add tags and hide/Spawn the Gameobjects all?
Answers would be appreciated.
Thanks for readin through
Cheers