Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

First Person Controller "Rigidbody"

Discussion in 'Scripting' started by Ka Ora!, Mar 16, 2010.

  1. Ka Ora!

    Ka Ora!

    Joined:
    Mar 11, 2010
    Posts:
    7
    Objective have the First Person Controller stick to a Sphere Planet like "glue/Velcro" but still be able to move around. Like Us on the planet Earth.(':)')



    After struggling with the Faux Gravity Script to get the FPC to be able to move around a Sphere Planet and not figuring it out I thought I would try the Explosion Force script with a negative value to achieve this same thing. It would not work on the First person controller when I applied it with a rigidbody, Is there a way to have the FPC affected by the AddExplosionForce script?

    Thanks :D :)
     
  2. Peter G

    Peter G

    Joined:
    Nov 21, 2009
    Posts:
    610
    Since the FPC uses a character controller, you will have to use the character controller class instead of the rigidbody. To answer your question, you would have to change the basic setup of one of the scripts, so no.
     
  3. Ka Ora!

    Ka Ora!

    Joined:
    Mar 11, 2010
    Posts:
    7
    There goes that idea.....Nevermind
     
  4. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,878
    err.. you just apply your own gravity, make a vector directed to the center of the planet and apply a reasonable gravity force along this vector. Doesnt matter rigidbody or collider you can move both.

    As your next question is going to be jumping and such stuff, you just take another vector to be used as UP which will be the opposite of gravity vector...and so on.