Search Unity

is Normalized?WTF?

Discussion in 'Editor & General Support' started by AaronC, Jul 25, 2006.

  1. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    What in gods name does this mean? Ive tried to get this off the consloe every way I can imagine. Does anyone have a clue what this could be? the only normals I can think of are to do with polygons and the face they are rendering.
    Help?!?!
    More precisely: !IsNormalized (normal)
    In the console: Assert in file: Plane.h at line: 56
    and: Assert in file: Plane.h at line: 84

    :eek: :eek: :eek: :!: :?: :evil:
     
  2. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Be more precise... when does this come up (what triggers it) and what are you trying to do?
     
  3. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Okay, Im trying to do 2 things with my submarine:1 Make it coast along, by itself. I have found I can do that either thru scripting, (Translate) and by using Constant Force(physics component.)
    But I also want to have it respond to first person controls, so it will go faster, slower and side to side.

    The instantiating of rigidbodies is crashing computers the world over too, but firstly its about this control system.
    If you check my atlantis post, youll see I actually did get the sub to behave how I wanted, and that was thru an elaborate mix of constant force, hinge joints parenting and when I booted Unity today, the sub now swings around in circles, although I haven changed anything. And no, I have no idea how I did it the first time, it just took a few days trying stuff.Maybe you could help me with this:

    Code (csharp):
    1.  
    2.  var forwardSpeed = 10;
    3.  var backwardSpeed = 5;
    4.  var strafeSpeed = 8;
    5.  function Update() {
    6.     transform.Translate(1, 0 * Time.deltaTime, 0);
    7. }
    8.  
    9.  function FixedUpdate () {
    10.     // Step1: Get your input values
    11.     horizontal = Input.GetAxis("Horizontal");
    12.     vertical = Input.GetAxis("Vertical");
    13.     // Step 2: Limit the movement on angles and then multiply those results
    14.     // by their appropriate speed variables
    15.     percentofpercent = Mathf.Abs(horizontal) + Mathf.Abs(vertical) - 1.0;
    16.     if (percentofpercent > 0.1) {
    17.        // if we're here, then we're not moving in a straight line
    18.        // my math here might be kinda confusing and sloppy...so don't look!
    19.        percentofpercent = percentofpercent * 10000;
    20.        percentofpercent = Mathf.Sqrt(percentofpercent);
    21.        percentofpercent = percentofpercent / 100;
    22.        finalMultiplier = percentofpercent * .25;
    23.        horizontal = horizontal - (horizontal * finalMultiplier);
    24.        vertical = vertical - (vertical * finalMultiplier);
    25.     }
    26.     if (vertical > 0) {
    27.        vertical = vertical * forwardSpeed;
    28.     }
    29.     if (vertical < 0) {
    30.        vertical = vertical * backwardSpeed;
    31.     }
    32.     horizontal = horizontal * strafeSpeed;
    33.     // Step 3: Derive a vector on which to travel, based on the combined
    34.     // influence of BOTH axes
    35.     tubeFinalVector = transform.TransformDirection (Vector3(horizontal,0,vertical));
    36.     // Step 4: Apply the final movement in world space
    37.     rigidbody.velocity.z = tubeFinalVector.z;
    38.     rigidbody.velocity.x = tubeFinalVector.x;
    39.  }
    40.  function Awake () {
    41.     rigidbody.freezeRotation = true;
    42.  }
    This is the FPS code with a function update(translate) inserted at the top. Is thee a reason the two dont work together? They also dont work together if I apply them as seperate scripts. Is there a way through parenting to achieve what I somehow did with the Atlantis control system?
    Thanks
    AC
     
  4. freyr

    freyr

    Joined:
    Apr 7, 2005
    Posts:
    1,148
    If you have a rigidbody attaced to an object, you must not manipulate the transform component directly.
     
  5. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Hey Thanks Freya, It worked once I removed all the rigidbodies. So let me know if this is correct:

    Rigdbodies subject the gameObject to Physics, and Physics overides Transforms?

    Im still not sure what "!isNormalized" means though.(see above post)
    Cheers
    AC
     
  6. freyr

    freyr

    Joined:
    Apr 7, 2005
    Posts:
    1,148
    Thats Freyr :p I'm not a girl...

    That's an internal assert statement inside Unity. It is harmless. I'm pretty sure it's a known bug, but just in case feel free to report it using the bug reporter app.
     
  7. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    So you are a God then? I knew it!

    Freyr "bestows peace and pleasure on frustrated Unity users". ;-)

    -Jeremy