Search Unity

Adding key and mouse navigation?

Discussion in 'Scripting' started by dansav, Apr 22, 2008.

  1. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    510
    How do you add key and mouse navigation to a world just through a script.

    My system is based on a null object--or a component with nothing in it, if I am using the correct lingo...

    Attached to that component is a single worldsetup.js script that controls everything.

    I want to add Navigation -- mouse and keystroke to this world. How do I do it? Do I have to add an avatar object and attach the mousescript to the camera and the avatar object? So far attaching the mousescript to the null object does nothing.

    Any help on the basic concept of how a script can interact with preset scripts or components? would be greatly appreciated..

    thanks,

    Dan
     
  2. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    510
    Just fyi I am coming from using Blink3d.
    Blink3d Has a built in Avatar and the following features

    arrows up down move avatar in z axis. The avatar walks.
    right/left move the on x axis, avatar walks

    mouse movement same thing.

    mouse or keys and ctl tilts head of avatar
    mouse or keys and shift moves avatar in Y direction.

    Is there some way to duplicate all of this in a few easy moves.

    Thanks,

    Dan
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    sounds like you wantto use character controller and mouse look and fpswalker on your can or did I missunderstand your target? perhaps a modified fpswalker depending on the usage or orbit instead of mouselook
     
  4. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    510
    At this point I don't know how to do anything really.

    I tried adding the first person contoller to a cube named Avatar, but it doesn't do anything.

    Also the first person controller brings in it's own camera, and I don't really know how to switch cameras.

    So I'm basically not getting very far by dragging and dropping objects around.

    Dan
     
  5. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552