- Home /
Problems entering in Fly Mode
I made a script for a FPS Game, wich lets your character fly. I already made the script for the flying guy, it works perfectly, but when i try to enter in fly mode, the object dosn't instantiate exactly in the old Player's position. This is the script:
var FlyMode : GameObject;
var Player : GameObject;
var FlyCamera : GameObject;
function Start(){
FlyCamera.SetActiveRecursively(false);
}
function Update() {
if(Input.GetKeyUp("f")){
var clone : GameObject = Instantiate(FlyMode, transform.position, transform.rotation);
Player.SetActiveRecursively(false);
FlyCamera.SetActiveRecursively(true);
}
}
Answer by DaveA · May 11, 2011 at 10:40 PM
This isn't how I'd do it (I'd modify the FPS walker to ignore gravity) but you could try
FlyMode, Player.transform.position, Player.transform.rotation
Your answer
Follow this Question
Related Questions
[Closed]Instantiate object to spesific location 1 Answer
Instantiating Multiple Clients into one 2 Answers
Instantiate a prefab results in a new prefab in a different location than expected 2 Answers
Instantiating for Item Generator Not Working? 1 Answer
Instantiate a random prefab at an objects location 3 Answers