x


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);

 }

}
more ▼

asked May 11 '11 at 07:31 PM

Demostones gravatar image

Demostones
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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
more ▼

answered May 11 '11 at 10:40 PM

DaveA gravatar image

DaveA
26.5k 151 171 256

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1672
x89
x80
x46
x31

asked: May 11 '11 at 07:31 PM

Seen: 842 times

Last Updated: May 11 '11 at 10:39 PM