Hey
Im making a mario kart-ish racing game and i got the characters to spawn just fine, except that they spawn in the wrong direction. So when they spawn i need to turn around for the lap system to work, and the stage is designed to work when driving a specific direction.
Any know how i can fix this?
The code is use is this
using UnityEngine;
using System.Collections;
public class CharacterSpawner : MonoBehaviour
{
public Transform player1Spawner;
public GameObject playerPrefab;
public Transform player1Camera;
// Use this for initialization
void Start ()
{
GameObject go=(GameObject)GameObject.Instantiate(playerPrefab,player1Spawner.position,player1Spawner.rotation);
GameObject go2=(GameObject)GameObject.Instantiate(Resources.Load(PlayerPrefs.GetString("playername")),player1Spawner.position,player1Spawner.rotation);
go2.transform.parent=go.transform;
player1Camera.GetComponent<SmoothFollow>().target=go.transform;
}
// Update is called once per frame
void Update ()
{
}
}