Unity Community


Results 1 to 5 of 5

  1. Posts
    8

    The left-hand side of an assignment must be a variable, a property or an indexer

    Hello there!

    Please I need some help, I'm just using the ActivateTrigger.cs and Im crashing with this errors:

    Assets/Standard Assets/Scripts/General Scripts/ActivateTrigger.cs(53,5: error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer

    And it points to the lines marked in red down here:


    switch (action) {
    case Mode.Trigger:
    targetGameObject.BroadcastMessage ("DoActivateTrigger");
    break;
    case Mode.Replace:
    if (source != null) {
    Object.Instantiate (source, targetGameObject.transform.position, targetGameObject.transform.rotation);
    DestroyObject (targetGameObject);
    }
    break;
    case Mode.Activate:
    targetGameObject.SetActive () = true;
    break;
    case Mode.Enable:
    if (targetBehaviour != null)
    targetBehaviour.enabled = true;
    break;
    case Mode.Animate:
    targetGameObject.animation.Play ();
    break;
    case Mode.Deactivate:
    targetGameObject.SetActive () = false;
    break;
    }
    }
    }

    I will thanks a lot any help you can give me,

    All the best and happy new year 2013!
    Thanks!


  2. Location
    Layton, Utah
    Posts
    320
    first, you really need to format your code using the code tags.

    You are trying to pass bool on the right hand side of equal sign... to a function, functions take parameters within the parentheses.. in this case.. it's a function.

    Code:  
    1. switch (action) {
    2.     case Mode.Trigger:
    3.         targetGameObject.BroadcastMessage ("DoActivateTrigger");
    4.         break;
    5.     case Mode.Replace:
    6.         if (source != null) {
    7.             Object.Instantiate (source, targetGameObject.transform.position, targetGameObject.transform.rotation);
    8.             DestroyObject (targetGameObject);
    9.         }
    10.         break;
    11.     case Mode.Activate:
    12.         targetGameObject.SetActive (true);
    13.         break;
    14.     case Mode.Enable:
    15.         if (targetBehaviour != null)
    16.             targetBehaviour.enabled = true;
    17.         break
    18.     case Mode.Animate:
    19.         targetGameObject.animation.Play ();
    20.         break
    21.     case Mode.Deactivate:
    22.         targetGameObject.SetActive (false);
    23.         break;
    24.     }
    Jordan Swapp(ware)
    Starter Kit Assets:Last Stand(demo) - UFO 3D(demo) - Cave Run 3D(demo) - War Planes 3D(demo)
    Kits are both in C# and JavaScript.


  3. Posts
    8
    Hi Landern!
    Thanks a lot for your answer! it was fixed.
    But I'm still having another error like this one:

    error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `Triangle' and no extension method `Triangle' of type `UnityEngine.Mesh' could be found (are you missing a using directive or an assembly reference?)

    pointing here in red too:

    }

    Mesh mesh = new Mesh();
    mesh.name = "Combined Mesh";
    mesh.vertices = vertices;
    mesh.normals = normals;
    mesh.colors = colors;
    mesh.uv = uv;
    mesh.uv1 = uv1;
    mesh.tangents = tangents;
    if (generateStrips)
    mesh.SetTriangle (strip, 0);
    else
    mesh.triangles = triangles;

    return mesh;
    }

    Any idea of what could be?
    Thanks for your support!

    Cheers!


  4. Location
    Walnut Creek, CA, USA
    Posts
    381


  5. Posts
    8
    Thanks a lot RazorCut!

    It was more clear after read the documents.
    Thanks for share!

    Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •