HeroEngine Forums

HeroEngine Developers => Developer Created Tutorials => Topic started by: Mr_Conflicts on Feb 07, 17, 05:01:08 PM

Title: Click to Move
Post by: Mr_Conflicts on Feb 07, 17, 05:01:08 PM
Hello, I wanted to create a basic tutorial to explain how to create a quick click to move system using the Input_Mouse script. This can be expanded upon to suit your needs but for this tutorial all we are doing is setting up the system to where you can click on the ground and move to the location you clicked.


Code: [Select]
heightmap as NodeRef = GetNodeUnderMouse()
target as Vector3
if not GetGroundUnderMouse(target, heightmap)
   return false
playerCharacter as NodeRef of Class HBNode = GetPlayerCharacterNode()
playercharacter["behave"] = "move navpoint " + target

You should now have a point click system in place!
Title: Re: Click to Move
Post by: Prometheus2012 on Feb 08, 17, 04:45:54 AM
Thats awesome!