⚪
Tank & Healer Studio Assets
Return to Website
Ultimate Joystick
Ultimate Joystick
  • 🟢Introduction
    • 👋Welcome!
    • ⚡Getting Started
  • 📖Documentation
    • UltimateJoystick
      • Public Methods
        • GetHorizontalAxis
        • GetVerticalAxis
        • Disable
        • Enable
        • UpdatePositioning
      • Static Methods
        • ReturnComponent
      • Events
      • Properties
  • 💡Tips & Tricks
    • Catching Tap Count
    • Custom Runtime Positioning
  • 🔗Helpful Links
    • Leave us a review!
    • Join our Discord server!
Powered by GitBook
On this page

Was this helpful?

  1. Documentation
  2. UltimateJoystick
  3. Public Methods

UpdatePositioning

This function is used internally to update the positioning of the joystick on the screen on Application start, and any time the screen changes size. You will most likely never need to use this.

using UnityEngine;

public class JoystickExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
	public UltimateJoystick joystick;

	void Update ()
	{
		// If the space bar has been pressed...
    		if( Input.GetKeyDown( KeyCode.Space ) )
    		{
    			// Update the positioning of the joystick to the exact center of the screen.
        		joystick.UpdatePositioning( 50, 50 );
        	}
	}
}

PreviousEnableNextStatic Methods

Last updated 1 year ago

Was this helpful?

📖