Jump to content

Search the Community

Showing results for tags 'cjs'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Found 1 result

  1. So this is where I would like to put any questions I have regarding the game I'm creating, like things I'm stuck on. First, Here is a script that is supposed to make it so I could move an object up and down, left and right, which in my case is for some reason the X and Z axis, not the X and Y axis, Idk if I could change some settings in Unity to make it X and Y axis but anyway, this script changes the X and Y axis, but I want it to change the X and Z axis, but for some reason when I try to make it X and Z axis it acts spazzy [code]using UnityEngine; using System.Collections; public class DragCube : MonoBehaviour { [SerializeField] float _horizontalLimit = 2.5f, _verticalLimit = 2.5f, dragSpeed = 0.1f; Transform cachedTransform; Vector3 startingPos; // Use this for initialization void Start () { cachedTransform = transform; startingPos = cachedTransform.position; } // Update is called once per frame void Update () { if (Input.touchCount > 0) { Vector2 deltaPosition = Input.GetTouch (0).deltaPosition; switch (Input.GetTouch (0).phase) { case TouchPhase.Began: break; case TouchPhase.Moved: DragObject(deltaPosition); break; case TouchPhase.Ended: break; } } } void DragObject(Vector2 deltaPosition) { cachedTransform.position = new Vector3(Mathf.Clamp((deltaPosition.x * dragSpeed) + cachedTransform.position.x, startingPos.x - _horizontalLimit, startingPos.x + _horizontalLimit), Mathf.Clamp((deltaPosition.y * dragSpeed) + cachedTransform.position.y, startingPos.y - _verticalLimit, startingPos.y + _verticalLimit), cachedTransform.position.z); } } [/code]