Home > Unity3d > Unity3d Javascript pathfinding

Unity3d Javascript pathfinding

October 8th, 2009 Leave a comment Go to comments

Its been a while since I posted something on Unity3d. I am currently working hard on porting to Javascript an open source (free) A star solution for small projects. Like always, i leave a lot of room for improvements. I really like to make people work a bit to get better ; )

In any cases I have started the scene graph implementation, A star search, Links and node creation. Nothing is tested but I am getting to a point where I can get visual cues from the main window. Now I just posted on the forum for help to get performance increase, because the drawing of the Gizmos is killing even my 4 core machine (lags a bit too much for my tastes). So I would like to know if there is a way to get the main #scene camera to do a simple distance check (simple occlusion) to draw less Gizmos on screen.

Offer some help here

Here’s the result

Update me when site is updated
Share and Enjoy:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Slashdot
  • Turn this article into a PDF!
  • Twitter
Categories: Unity3d
  1. October 8th, 2009 at 13:30 | #1

    I am able to access the #scene camera using Camera.current, however I’m doing this in the OnScene() call of an Editor class object; I don’t know if it’ll work in OnDrawGizmos(). You might also want to try your luck using Camera.allCameras.

  2. admin
    October 8th, 2009 at 14:13 | #2

    It seems that Camera.current does work. I finally nailed it using the following :

    if(Vector3.Distance(Camera.current.transform.position, obj.transform.position) < 15)

    works pretty well :) thanks for the advice !

  3. Keith
    April 12th, 2010 at 15:47 | #3

    I was wondering if you had the JavaScript A* solution done yet? I am trying to do something similar, but am completely new to unity, so it is going very slow for me, and I would love to get your code to help me with it. Please let me know. Thanks

  4. Roychr
    April 12th, 2010 at 18:48 | #4

    I let go this enterprise, there will be debugging support enabled in Unity3d version 3 expected to be released in the summer of 2010. I suggest you go to http://www.arongranberg.com/unity/a-pathfinding/ to get an excellent and easy to include path finding solution made in CSharp.

  1. October 11th, 2009 at 07:02 | #1