Android how to prevent restart the activity on orientation change.

For manual orientation change:

[php]
<activity
android:name=".ActivityName"
android:configChanges="orientation"/>
[/php]

[php]

public class ActivityName extends Activity {

onStart() {
setRequestedOrientation(orientation);
}
onConfigurationChanged(Configuration newConfig){
// do stuff for orientation change.
}
onClick() {
setRequestedOrientation(orientation);
}
}

[/php]

For auto-orientation detect:

[php]
<activity
android:name=".ActivityName"
android:configChanges="orientation"/>

[/php]

[php]

public class ActivityName extends Activity {

onConfigurationChanged(Configuration newConfig){
// do stuff for orientation change.
}
}
[/php]

Unity 3d – Script Collection

Player Follow the Camera Script

[java]
using UnityEngine;
using System.Collections;

public class CompleteCameraController : MonoBehaviour {

public GameObject player;
//Public variable to store a reference to the player game object

private Vector3 offset;
//Private variable to store the offset distance between the player and camera

// Use this for initialization
void Start ()
{
//Calculate and store the offset value by getting the distance between
//the player’s position and camera’s position.
offset = transform.position – player.transform.position;
}

// LateUpdate is called after Update each frame
void LateUpdate ()
{
// Set the position of the camera’s transform to be the same as the player’s,
// but offset by the calculated offset distance.
transform.position = player.transform.position + offset;
}
}

[/java]

Player Move/Transform (Left)

[php]&lt;
using UnityEngine;
using System.Collections;

public class obstacleMoves : MonoBehaviour {

public float obstaclemMoveSpeed=10.4f;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
transform.Translate (-Vector2.right*obstaclemMoveSpeed*Time.deltaTime);

}
}
[/php]

Player Move , jump and rotate

[php]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MovePlayer : MonoBehaviour
{

public float speed = 6.0F;
public float jumpSpeed = 8.0F;
public float gravity = 20.0F;
public float rotateSpeed = 3.0F;
private Vector3 moveDirection = Vector3.zero;

// Use this for initialization
void Start()
{

}

// Update is called once per frame
void Update()
{

CharacterController controller = GetComponent<CharacterController>();
if (controller.isGrounded)
{
moveDirection = new Vector3(0, 0, Input.GetAxis("Vertical"));
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
if (Input.GetButton("Jump"))
moveDirection.y = jumpSpeed;

}
moveDirection.y -= gravity * Time.deltaTime;
controller.Move(moveDirection * Time.deltaTime);

//Rotate Player
transform.Rotate(0, Input.GetAxis("Horizontal"), 0);

}
}
[/php]

Unity 3d game development tutorial : part 1 – Introduction and Installation.

Whether you’re looking for a game industry career or simply curious about the way game developers think, Extra Credits makes video game design approachable by exploring concepts like gamification, perfect imbalance, the skinner box, the uncanny valley, and more, since these games are really popular with kids now a days, since is one of the activities kids enjoy among others like jumper castles in children’s bday parties from http://www.jumpersjungle.com/riverside/ and more. Sometimes we also like to recommend a few games you might not have tried! Join us on Extra Credits every Wednesday as we take a deeper look at games: how they are made, what they mean, and how we can make them better.