Turn to object at "look at" command

  • #1, by anatolySaturday, 29. December 2018, 02:17 5 years ago
    Hello! I want to do that when using the command "look at" character does not walk to the object, but only turned to him. How to do it?

    Newbie

    3 Posts


  • #2, by afrlmeSaturday, 29. December 2018, 11:35 5 years ago
    use execute command (immediate) instead of execute command at destination. you can insert an align character to object action part to align them to the object, but it's not very accurate as it aligns the character based on their position (the position is based on where you set the animation center for the character - usually somewhere near their feet) to the position of the object (this is where you specified the interaction position for the object & not the actual position of the image/animation belonging to the object).

    If you want super accurate alignment, you will need to use Lua script to calculate if your characters position is above or below the object (depends on if the character can actually go above or below or they are always above or below) you want to align to & then you use a bunch of if else queries to check if character is in a specific position/section of the scene & then you use that to set the alignment.

    in the screenshot below, my character is always below the objects in the scene, so I just checked their position inside of a bunch of ranges in the scene to decide if the character should be facing west, north west, north, north east, or east.

    I recommend trying the none-Lua method I mentioned first though as it's much less confusing.

    Imperator

    7278 Posts