Hello, Friends This me Gour Hari Ghosh. Here is this Content Abobe see you Heading. I Told you
easy way setup Camera unity 2d Game development. if you learn other Setup for a unity game.
Please see the Other Content. unity Camera Setup so Easy friends. First, you learn to code. Friends C# language.
you see the unity C# coding And Create your unity 2d Game. But don't learn unity C# Coding
Remember your not a good game developer for the Unity Engine. because of A good game
developer's fist understands theUnity C# coding After that Create your Unity 2d games.
Here Above See the unity 2d game Image, I am creating a unity 2d game. how to create unity 2d
game Camera setting. let's talk all Details
Friends first unity 2d game engine complete your project unity 2d character setup After that
create unity 2d game engine GameControlerScript Assets just like Above the Image. And 2d unity
Engine Hierarchy
Right, Mouse clicks and createempty you see the GameObject. This unity 2d GameObject right Mouse click
rename it GameControler. now drag your scrip to you GameControler GameObject. Now you unity
2d game
See GameObject Gamecontrler transform position All X, Y, Z value set 0 shows the Images
unity 2d game engine Asset Duble click GameController Script Open it you coding Editor Just
like Mono developer or visual studio. you see the coding all complete Gamecontroler Script
you see it
unity 2d Gamecontrler Scripts
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class gamecontrler : MonoBehaviour {
public Transform playertranform,camEsc,camDir,camSub,cambas; // This your unity 2d GameCotroler Objcet tranansform all.
private Camera cm; // This your unity 2d camera varibale
public float camspeeed; // This your unity 2d cherater camera speed varivale
// Use this for initialization void Start () {
cm = Camera.main; // here Are set Your unity 2d camer for Start } // Update is called once per frame void Update () { }
void LateUpdate()
{
float poscamX = playertranform.position.x; // here unity 2d player tranform posin varible
float poscamY = playertranform.position.y;
unity 2d coding you Complete After that go to your unity 2d game engine Gamecontroler Object below
unity 2d create Game empty and name it camesc, copy it And three time past it And re name it camdir,
camsub, cambas All z transform -10 see bnelow Image
you Look Image And the same to you do it. you play unity 2d game you look you camera move
properly.
mow Expleane you're All camera direction Remember I told you here are fourth camera diration
fast camera directioncamesc :- what is camesc diration ? camesc your player diration. camesc GameObeject selected And unity Move Toll drag Any whare camera poison begin it fast. second camera directioncamdir :-what is camdir diration ?
camdir diration are not moveing the camera. camdir GameOjet selected And unity Move toll drag
Anywhere and you play game character go to your camdir gameObject drag position this time
camera Movement not work.
Third camera directioncamsub :-what is camsub diration ?
camsub diration are not moveing the camera. camsub GameOjet selected And unity Move toll drag
up the playerCherater and you play game character go to jump your camsub gameObject drag
position this time camera Movement not work.
Fourthcamera directioncambas :-what is cambas diration ?
cambase diraction is the Main camera diraction you selected cambase gameObject And Main
camera All position copy And cambas gameObject transform past value After that you play
unity 2d game And position your MainCamera set.
So friends you Any problem please visit my youtube channel dbz shiva and see the video
How to setup unity 2d Game Development Android Button?
Hello, friends this me gour. so you look Above the Heading. How to setup unity 2d Game Development
Android Button.a friend I tell you how to set up button first, create your project.
unity 2d game development first creates your project. then go to your File and bulid Setting and select
your Android plateform swich platform. unity 2d game development engine all you project convert
Android plateform.After that you go go to Asset store download the StanderAsset And Import your
unity 2d game development engine.After that friends you Hirachay panel right Mouse click and create your
UI Button.
After that friends go to your canvas Selected & Render Modescreen Space-camera. or Selected Render camera to MainCamera.
Now Friends go to your unity 2d game Button Seleted And you see Target graphice .Here are you selected your Sprite Button Image. After that go to your Stander Asset folderdueble click And open it you lookcroseplateformInpute Open it. Then you SeeScripts Floder
duble click Open it. Then you see All Scripts now you selected One Scripts name it AxiesTouchButton drag it the button . Now you see Button under Script button name leftbutton. Then Ctl+C and copy it.
Ctrl+V past it. secendButton Name RightButton.Here are I am past the playerContrloller Scripts. After that Right button selected copy And past and name it jumpButton. you see jumpbutton Script Axiestouchbutton
remove. and go to your Scripts folders ButtonHandlear Scripts drag your JumpButton. After that JumpButton Seleceted copy and past this Button name it AttackButton.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityStandardAssets.CrossPlatformInput; // friends this Must bee one this varivale Importent. public class playercontrole : MonoBehaviour { private Rigidbody2D playerrb; public float speed; public float jump; public bool islookleft; private Animator anim; private bool isground; public Transform isgroud;
// Use this for initialization void Start() { playerrb = GetComponent<Rigidbody2D>(); anim = GetComponent<Animator>();
}
// Update is called once per frame void Update() {
Movement(); fixupdate();
}
void Movement() { float h = CrossPlatformInputManager.GetAxisRaw("Horizontal"); // This your button left And right button input playerrb.velocity = new Vector2(h * speed, playerrb.velocity.y); //This Horizontal name And button scripts name same it if you not same you it your button not work anim.SetInteger("speed", (int)h); anim.SetBool("isground", isground); anim.SetFloat("Blend", playerrb.velocity.y);
if (h > 0 && islookleft == true) { Flip(); } else if (h < 0 && islookleft == false) { Flip(); } if (CrossPlatformInputManager.GetButtonDown("Attack")) // This your Attack button
{ anim.SetTrigger("Attack"); }
if (CrossPlatformInputManager.GetButtonDown("Jump") && isground == true) // This your jump button { playerrb.AddForce(new Vector3(0, jump));
}
} void Flip() { islookleft = !islookleft; float x = transform.localScale.x * -1; transform.localScale = new Vector3(x, transform.localScale.y, transform.localScale.z);
This Image AxiestouchButton scripts Axes name Horizontal. Axes value -1. why -1 value use . It use that your rigid charater move left side And rightButton not -1 just like Image. LeftButton After that Response
Speed 1000 or Right button Response speed same1000 After that you play you game you see it working your left And right button. now set the JumpButton go to you button HandelerSecripts you look funcane
Name - Jump. this name Scripts name same it . you do not use same name your JumpButton not work
on click() look you you don't see the funcation plaese click + sine noneObject seleted your jump button.Now you see no function selected you buttonHandeler and seleceted SetupState()After that + sine click
noneObject seleted your jump button.Now you see no function selected you buttonHandeler and seleceted SetdownState()Same function for use Attack button
. but name your Attack. player controller Scripts
you don't under stand plaese look my video this my you tube channel dbz shiva
so friends visit my youtube Channel see my all unity 2d game development. or subscribe my youtbe channel. pleasse any problem plasee comment.