- Home /
How to create good Collision (point & click 3d)
Hi,
(sorry for my english)
Since few weeks, I try to create a Rpg-like with unity (Point and click for the deplacement and Top camera like Ragnarok online (http://img.jeuxvideo.fr/00432205-photo-ragnarok-online.jpg))
I have problem with collision between my character and the background. At start I used script and code but now I use Uscript (can we do an entire Rpg with uscript ?). Camera and point & click deplacement works pretty well when its on a flat surface but it gets complicated when I add obstacle like tree, rocks or when my surface isnt flat.
I wish something simple like that:
-When I click on a field and the Y (raycasthit, vector3) is < (to my current position) 0,5 my character move to this place
-If I click on a obstacle (tree, rocks), on a field with Y > 0,5 or in an empty position: My character stop / dont move.
I show you my problem with screenshot.
I wish my character can only move on the green surface
http://www.noelshack.com/2013-32-1375903327-green.jpg
Actually i Just created a mesh collider on my island and when I click on a side, my character walk vertically on this side instead of not moving.
http://www.noelshack.com/2013-32-1375903570-walkwall.jpg
Same problem, I made a box collider on my tree, and when I click on it, my character walk vertically.
http://www.noelshack.com/2013-32-1375903757-treewalk.jpg
I tried to froze Y position and X/Z rotation of my character but it dont change anything.
Thx for any help