- Home /
The question is answered, right answer was accepted
Object Spawning Too Low
I have a object I am trying to spawn under my player and when it does though right now its spawning to low. Some how I need to make the object spawn a little higher. If I make the character jump and when its in the air spawn my object under it, it works fine. Is there any way I can add something to lift the character up on the Y axis some during this spawn?
GameObject clone = Instantiate(prefabToSpawn,spawn.position , spawn.rotation)as GameObject;
thisChar.transform.parent = clone.transform;//Sets the character as a child of the mount.
thisChar.GetComponent<ThirdPersonController>().enabled = false;//Turns off the third person controller.
thisChar.animation.Play("idle");//This causes the player to go to the desired aniamtion when mounted.
clone.GetComponent<HoverCommand>().enabled = true;
isMounted = true;//tells us that we are mounted.
Some how I need to move the character up so when it spawns under it, it don't throw off the mount.
Don't you simply need to increase the y value of spawn.position before calling this code?
Yes, I have never done that before and somewhere I cant pull it off.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Setting Spawn Rotation correct 1 Answer
Distribute terrain in zones 3 Answers
Spawning off size blocks 1 Answer
Spawning A Grid Of Cubes 2 Answers