News Forums Troubleshooting Manipulating Body.transform in Custom Action

This topic contains 0 replies, has 1 voice, and was last updated by  calebm 1 week, 2 days ago.

Viewing 1 post (of 1 total)
  • Author
  • #29407


    Is it possible to change the transform in the Body of an AI?

    I have a custom action for making my turret rotate back and forth. I’ve taken the same code and put it into a normal Unity behavior and it works just fine. In the RAIN action, nothing I do to alter the transform seems to take effect.

    Using Debug.Log() statements I’ve determined that the AIs Execute() action is running constantly, as expected, so my rotation should be also.

    As an example, this code should rotate the body 5 degrees around the center of its body, but nothing happens.

        public override ActionResult Execute(AI ai)
    		ai.Body.transform.RotateAround(ai.Body.transform.position, ai.Body.transform.up, 5f);
    		return ActionResult.RUNNING;

    Is it not possible, or just ill-advised, to manipulate the transform from a custom action? Or am I just missing something?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.