Search Unity

Lego MoveAction: how do I change specific moveaction parameters via a trigger?

Discussion in 'Getting Started' started by sarahkastisk, Apr 12, 2021.

  1. sarahkastisk

    sarahkastisk

    Joined:
    Apr 12, 2021
    Posts:
    1
    Hey there! Am totally new to Unity and haven't done much programming since VisualBasic in high school. I have *some* idea of what *should* be possible, but don't know how to make it happen in Unity.

    Trying to learn by making a Lego Microgame and have built a cat that I want to follow my player character - but *not* to bump into and kill my character (it's a friend, not an enemy!)

    So. I suppose the solution would be some sort of nearbytrigger which could set the moveaction to distance=0 whenever cat is nearby player character. But moveaction distance should be higher than 0 whenever cat is not nearby character - because I don't want cat to stop moving permanently, I just specifically want cat to stand still when it is right next to player character. Otherwise we get colission and death.

    I guess there is some code underneath the visual interface, but I cannot find it. So right now the program only gives me the option of making a trigger that activates a moveaction - I can't change specific parameters (change distance to 0 or back to higher) via a trigger.

    Can anyone help?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I haven't done the LEGO tutorial, so I don't know how it's set up. I can say that what you're trying to do would be pretty simple in C# code. But it sounds like they've given you some kind of visual interface... which means, what you want to do may be easy, or it may not be possible at all.

    Probably you should just stick to whatever the tutorial has you doing, until you're ready to go beyond that and learn real coding.