Forum rules - please read before posting.

[UFPS+AC] How do i draw line using the AC

So we are working now new mode:

On start, theres an AC menu which the player will select where he wants to go.
Then after he selected, theres a line that will draw to the distance of the player and the destination on the floor, this will serve as a guide.

How do I do it? Do i need like the draw line renderer to to that?


Comments

  • edited February 2017
    Yes, a custom script could leverage a LineRenderer to do that.  From AC's side of things, you'd need to read both the player's position, and their destination (once moving) in order to draw the line.  These can be found in the scripting guide:

    Vector3 startPosition = AC.KickStarter.player.transform.position;
    Vector3 endPosition = AC.KickStarter.player.GetTargetPosition ();
  • Hey Chris! Do I need some navmesh in order to make this happen? It's confusing me.
  • If you want the Player character to move outside of the game-player's direct control, then yes.

    The code I posted assumes that your Player is already moving along a navigation path (generated when the Character: Move to point Action is used).  If you want to draw a line between a player when stationary and some other destination, you don't need to access his internal functions.

    If you're in need of more advice about this, you're going to have to give more detail about what it is exactly you're looking to do - and what you've managed to do so far.  Any screenshots or illustrations you can provide will make things much easier to convey.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.