You got to control a small planet with 3 prehistric humans on it’s surface. They will always stay on top. Rotate the planet to navigate them througth it’s valley and pick up goodies / avoid badies. Critts Comments very welcome
About Smoothing LooK:
I have to be very low-poly 160 tris for Pickups and below 500 for the characters.
I gave the smoothing a try, but i dont like it. I want it to be very hard edgy pastel. Maybe Unity 2.6 does it have the Screenspace Ambient Oclustion in the free version ?
to Abdullah.Ahmed
The game wont be finished it’s more like a experiment at the course in University. But i will post a litte playable version. It was for me to get started with unity.
The Planet and stuff was modeled by hand in ( I like Silo 3d ). I can post some scripts and comment them if you like. It’s mostly simple stuff like rotate the planet, a follow translate for thr humies , and a on Collision Picup script.
Maybe a smoothing style like this, half smooth half edgy
I have to do Präsentation on 5.Feb so i can release a playable version on 6.Beb or so, I have to get some Webspace.
About mechanics:
They dont walk! They are just Cubes Rigid Bodies who slide on the surface. You rotate the Planet and the cubes get actracted to the white sphere which is on top.
The cam zooms with translate
The planet is rotated
And the humies keep close to the target
Cam Script:
function Update () {
if (Input.GetKey ("a"))
{
transform.Translate(Vector3.forward * Time.deltaTime * 20);
}
if (Input.GetKey ("y"))
{
transform.Translate(Vector3.forward * Time.deltaTime * -20);
}
}
Does nothig but moe the cam towards the planet
Planet Script
function Update () {
if (Input.GetKey ("up"))
{
transform.Rotate(Time.deltaTime * -12, 0, 0, Space.World);
}
if (Input.GetKey ("down"))
{
transform.Rotate(Time.deltaTime * 12, 0, 0, Space.World);
}
if (Input.GetKey ("left"))
{
transform.Rotate(0, 0, Time.deltaTime * -22, Space.World);
}
if (Input.GetKey ("right"))
{
transform.Rotate(0, 0, Time.deltaTime * 22, Space.World);
}
}
Rotate Planet with arrow script
Humie Script
var leader : Transform;
var speed : float = 2.0;
var chaseRange : float = 10.0;
private var range : float;
function Update(){
// Calculate the distance between the follower and the leader.
range = Vector3.Distance( transform.position,leader.position );
if ( range >= chaseRange ){
dir = leader.transform.position - transform.position;
dir = dir.normalized;
transform.Translate(dir * speed * Time.deltaTime, Space.World);
}
else {
return;
}
}
move towards target until specified distance is reached ( keeps the humies on top of planet and togehter )
Pickup Stuff Script:
var sound : AudioClip;
var soundVolume : float = 2.0;
var player : GameObject;
var pointsGood : int = 10;
// rotate Object
function Update() {
transform.Rotate( 0, 0, Time.deltaTime * 30, Space.Self);
// Set the x position to loop between 0 and 3
//transform.localPosition.y = Mathf.PingPong(Time.time, 3);
}
function OnCollisionEnter(collision:Collision)
{
player.GetComponent("Player").AddPoints(pointsGood);
// Play sound
if (sound)
AudioSource.PlayClipAtPoint(sound, transform.position, soundVolume);
Destroy(gameObject);
}
Attach to pickable Item ( Items are childs of planet to be rotated with the planet)
It can play a sound !
Point Counter
private var punkte:int = 0;
var ausgabe:String;
function OnGUI ()
{
ausgabe = "Punkte: " + punkte.ToString();
GUI.Label (Rect (10, 10, 100, 20), ausgabe);
}
function AddPoints(neuepunkte:int)
{
punkte+=neuepunkte;
Debug.Log("Punkte: " + punkte);
}
Attach anywhere, it will count your collected Points and print to the GUI
( sorry :? punkte = points , ausgabe = output )
So i setup a test project last night and still wasnt working quiet right
I have a camera looking down at the planet (zoom in/out works great)
I have a sphere for my planet (with planet script attached), arrow keys rotate great
I have an empty game object representing the target (is this a child of your planet object? so it rotates with the planet )
I have a capsule standing on the planet representing a player. Its leader is set to the empty game object correct?
I have a second capsule for another player, its leader is set to capsule 1 ? correct ?
I know im close, just missing something. Planet rotates e.t.c but the capsules never move (i think its becuase my target is not moving with the planet).
Does your players rotate there angle dependent on where the target is ?
Dont get the wrong Idea about my game. At first i wanted it similar to yours. Small guys realy walking on the Surface but it did not work. Try the locomotion system at the unity3d homepage extensions, this really walks a character on a sphere.
I did a workaround, my characters are just cubes (riggid bodies) bouncing around on top of the sphere. They do not walk, they just slide.