Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))  (Read 199 times)

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile

I'm going to keep a log of sorts to keep track of my progress in the learning of Unity. If you have problems with Unity, take them elsewhere, I don't care if you hate it.

But other than that, any help is welcome! But keep in mind that I am still a beginner. I'll update this later tonight with any progress I've made, even if it's the tiniest little bit of progress!
« Last Edit: February 02, 2016, 10:17:45 pm by XhAPPYSLApX »
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #1 on: February 02, 2016, 10:20:43 pm »

I made a little progress, learned some basic commands like if statements and Input.GetKey, and transform.

Unfortunately, I couldn't get pictures or video of my very humble start. (Lightning storm in f*cking winter)

But I will try tomorrow. Other than that, it's going pretty smoothly so far.
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.

Araph

  • Bay Watcher
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #2 on: February 03, 2016, 01:37:50 am »

Unity's a great place to start. Even better, it's also a great place to be after starting.

Good luck! If you keep at it, you'll have the bulk of it figured out soon enough. When you run into problems, Unity Answers and the documentation are lifesavers. If the problem is incomprehensible, I'll help if I can.
Logged
Wardens of Teros - Warden has returned from beyond the grave!
Tumblr
DeviantArt

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #3 on: February 03, 2016, 11:26:07 am »

Unity's a great place to start. Even better, it's also a great place to be after starting.

Good luck! If you keep at it, you'll have the bulk of it figured out soon enough. When you run into problems, Unity Answers and the documentation are lifesavers. If the problem is incomprehensible, I'll help if I can.

Awesome! Thanks, I'll be sure to come to you if I can't figure some syntax, or whatever out. I'm actually surprised, I thought everyone says 'Unity sucks!' When obviously it doesn't, since Wasteland 2, Cities Skylines, and even Pillars of Eternity were made on it!


I haven't made more progress since yesterday, mostly because I don't have constant access to a relatively high-power computer, which means I should start taking more some reference notes :D
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #4 on: February 03, 2016, 03:50:22 pm »

I've learned a bit about camera movement, more specifically dragging.

Can't wait to try it out, and unintentionally break it :D
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.

Dorsidwarf

  • Bay Watcher
  • [INTERSTELLAR]
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #5 on: February 03, 2016, 06:13:47 pm »

I ran into the hurdles while trying to learn Unity, so my heart goes out to you and I hope you persevere more than I!
Logged
It's a beautiful day to be demolishing the dreams of bureaucrats, unless you're being assassinated
Sigs for the sig throne!

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #6 on: February 03, 2016, 09:41:13 pm »

I ran into the hurdles while trying to learn Unity, so my heart goes out to you and I hope you persevere more than I!

I hope I can, I've always wanted to make games, so I bet I can persevere based on my want alone.
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #7 on: February 04, 2016, 02:44:34 pm »

I've tried to use this common script for camera movement, but I just can't seem to get it to move vertically.

Spoiler (click to show/hide)

Tried doubling it, but using the y axis in place of the x axis in the same places, as well as changing left and right to up and down. But it always just moves left and right still.

The reason I use this script is because the person that made it says that it creates camera boundaries, which it indeed does, but it won't be of much use until I can get the y axis in there.

Also made Screen.width instances into Screen.height instead, still didn't work.

I've tried for at least two hours to get it to work, but I'm at a bit of a loss, Araph, any advice?
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.

Araph

  • Bay Watcher
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #8 on: February 04, 2016, 03:28:56 pm »

It looks like you're getting the difference between the current mouse position and the position of the mouse when you first press the left mouse button and using that to adjust the position of the camera, but in this line...
Code: [Select]
Vector3 move = new Vector3(pos.x * dragSpeed, 0, 0);...you're only adjusting the camera's position on the x axis. If you change it to...
Code: [Select]
Vector3 move = new Vector3(pos.x * dragSpeed, pos.y * dragSpeed, 0);...it should make the camera move on both the x and y axes. Bear in mind that you're only checking for boundaries at the left and right sides of the screen, not the top and bottom as well.

I would recommend steering clear of using other people's scripts while learning programming. As a general rule, you should avoid using any chunks of code that you don't understand (otherwise you run the risk of unexpected behaviors in your program). You'll get farther by looking up basic scripting tutorials and going from there rather than attempting to jury-rig preexisting scripts to create the game you're picturing.
« Last Edit: February 04, 2016, 03:30:27 pm by Araph »
Logged
Wardens of Teros - Warden has returned from beyond the grave!
Tumblr
DeviantArt

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #9 on: February 04, 2016, 04:00:20 pm »

It looks like you're getting the difference between the current mouse position and the position of the mouse when you first press the left mouse button and using that to adjust the position of the camera, but in this line...
Code: [Select]
Vector3 move = new Vector3(pos.x * dragSpeed, 0, 0);...you're only adjusting the camera's position on the x axis. If you change it to...
Code: [Select]
Vector3 move = new Vector3(pos.x * dragSpeed, pos.y * dragSpeed, 0);...it should make the camera move on both the x and y axes. Bear in mind that you're only checking for boundaries at the left and right sides of the screen, not the top and bottom as well.

I would recommend steering clear of using other people's scripts while learning programming. As a general rule, you should avoid using any chunks of code that you don't understand (otherwise you run the risk of unexpected behaviors in your program). You'll get farther by looking up basic scripting tutorials and going from there rather than attempting to jury-rig preexisting scripts to create the game you're picturing.

Thanks for the heads up, and I'll definitely steer clear from stuff like this in the future, just gonna watch tutorials instead of trying to make sense of stuff that I don't know a whole lot about yet.
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.

XhAPPYSLApX

  • Bay Watcher
  • Coff-e, the coffee cup.
    • View Profile
Re: UnityLog: My quest to learning Unity.(Feb 2nd - 7th: Movement (2D))
« Reply #10 on: February 08, 2016, 02:58:15 pm »

Haven't been near Unity in a few days, been playing a tad too much XCOM 2 :P

But I'm getting back into it with video tutorials.
Logged
I IS SCIENTISTIC! - an exceptionally dumb Courier, Fallout New Vegas.