Set Direction Of Character To Certain Number

Discussion in 'How Can I...?' started by dewball, Apr 25, 2020.

  1. dewball

    dewball Boxer

    Joined:
    Apr 11, 2020
    Messages:
    15
    Likes Received:
    3
    Hello there,
    In my game I wanted the character to point n degrees when the screen is clicked. However, I cannot find any sort of node in buildbox to do so.

    I tried making my own script as well. I am a beginner in this, so sorry if my attempt was brutally wrong.
    I created a block called, "Set direction" and in the update() function I added this line of code:
    this.entity().setDirection(0,*insert n*,0);
    However, the program still didnt work.

    How can I set the direction of a character to any number?
     
  2. alexsafayan

    alexsafayan Boxer

    Joined:
    Oct 14, 2016
    Messages:
    73
    Likes Received:
    14
    this.entity().setRotation(0,*insert n*,0); should work
     
  3. dewball

    dewball Boxer

    Joined:
    Apr 11, 2020
    Messages:
    15
    Likes Received:
    3
    Thank You. :)
     

Share This Page