Unity Community

Results 1 to 5 of 5

  1. Posts

    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");
    case Mode.Replace:
    if (source != null) {
    Object.Instantiate (source, targetGameObject.transform.position, targetGameObject.transform.rotation);
    DestroyObject (targetGameObject);
    case Mode.Activate:
    targetGameObject.SetActive () = true;
    case Mode.Enable:
    if (targetBehaviour != null)
    targetBehaviour.enabled = true;
    case Mode.Animate:
    targetGameObject.animation.Play ();
    case Mode.Deactivate:
    targetGameObject.SetActive () = false;

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

    All the best and happy new year 2013!

  2. Location
    Layton, Utah
    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.

    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
    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);
    mesh.triangles = triangles;

    return mesh;

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


  4. Location
    Walnut Creek, CA, USA

  5. Posts
    Thanks a lot RazorCut!

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


Posting Permissions

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