Forum rules - please read before posting.

Diablo style point and click controls

Is there a way to get Diablo style point and click controls? I'd like something that works like 'Straight to Cursor' but on mouse up it would continue to walk to the spot(where you last mouse up'd.) 

This is very useful when you have a follow camera and your character needs to walk long distances.  

Comments

  • After searching the forum I see you added the 'Single-clicking also moves the player?' / 'Pathfind when single-clicking?' options to almost handle this situation.

    I would love it if we could trigger a pathfind on mouse up. 
  • A custom script could handle that - just look for a Unity mouse-up event, and provided that you're in normal gameplay, ie:

    AC.KickStarter.stateHandler.gameState == AC.GameState.Normal

    Then point and click to the mouse's location:

    Vector3[] pointArray = AC.KickStarter.navigationManager.navigationEngine.GetPointsArray (KickStarter.player.transform.position, pointToMoveTo, AC.KickStarter.player);
    AC.KickStarter.player.MoveAlongPoints (pointArray, false);

    (Where "pointToMoveTo" is the position to move to in world space.)
  • Wow thank you Chris! I'll try this out. I think I'll need to figure out how to make it interact on mouse up as well. If you've played Diablo, if you release the mouse on chest, the character walks toward it and opens the chest. This code looks like he'll just walk over and you'll have to click again.
  • So I tried, unfortunately this only seems to work in Point and Click mode. The mouseup works and thte player walks to the correct spot.

    However when using the same script while set to Straight to Cursor mode, the character glitches for a frame and then doesn't respond to mouseUp.


  • You may have to switch your "Movement method" to "None" and code your intended behaviour in a separate script in that case.  You can use the included PlayerMovement.cs script as a basis for it, but bear in mind that AC by itself is intended for more traditional adventure games, rather than RPGs.
  • I figured as much, thanks for your help!
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.