EDit: Clarification Here is the desired effect
- Player Spawns (or ReSpawns)
- He starts at a position off camera on X axis
- The player slowly moves onto screen
- This Effect should be visible over a few frames (this shouldn't happen instantly)
If you don't have answer, can you point me in the direction of this information? Thanks.
Old Info Below:
Hi All,
I am doing a top down shooter (1945) I would like the player to move smoothly onto the screen from off screen. To explain, the camera is fixed overhead, the player will start in a position that is not visible. When the player is at the correct position, (in this case X) I want the player to be able to control the ship. Below is my attempt. The character simply starts at his spawn point, and does not move any further. What am I doing wrong? I can explain further, let me know if this is unclear.
Instantiate(Player, Vector3(-43, 114, 4.5), Quaternion.Euler(0, -180,0));
function Update ()
{
while(transform.position.x < 10)
{
// move the ship on screen
var amtTomove = shipmoveonscreen * Time.deltaTime ;
transform.position = new Vector3(transform.position.x + amtTomove, transform.position.y, transform.position.z);
}
if (state != state.Explosion)
{
var playervertical = (playerSpeed * Input.GetAxis ("Vertical") )* Time.deltaTime;
transform.Translate(Vector3.left * playervertical);
}
}
I apologize for the code readability.... It may be a bit unclear.
– anon40666834