Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

I need help making my game work

Discussion in 'WebGL' started by bigdant, Dec 10, 2015.

  1. bigdant

    bigdant

    Joined:
    Dec 10, 2015
    Posts:
    1
    Hi. I'm new to webGL and I'm working on a project for class. The project is very simple. There's a triangle drawn on the screen and I want to be able to move it around the screen like you would move the ship from asteroids around the screen. My problem is that I can't get the "ship" movement behavior to actually move around. I can get it to rotate in place, but whenever you try to move away from the center point it moves within a radius around the center point. This may take some digging into for anybody who's willing to help, but I'm pretty much completely stuck. Here's the code in a github repo if anybody is kind enough to check it out. https://github.com/Claytonhaddock/webGL.git
     
  2. Zaelot

    Zaelot

    Joined:
    Mar 26, 2015
    Posts:
    12
    Sounds like your camera is fixed to your player object (perhaps as a child of the GameObject or through a camera control script).
    Player.transform.position and Player.transform.localPosition can be changed to affect the movement on your GameObject (remember to use full Vector3's). Player.transform.Translate() can also be used.