- Home /
...Why does this FAIL? - DontDestroyOnLoad()??
Hello, again, Im trying to get this to work...
function Start () {
DontDestroyOnLoad(Transform.GameObject);
}
but it always fails... the scene is always grey... this code is in the first person controler object, in a new script called make Presistint... Please help? sorrry if any of this is noob stuff :(
Transform shouldn't be capitalized, nor should the G in GameObject. There's a huge difference.
THAN$$anonymous$$S :)... that problem is solved... but now... how do i set the player position to another object's position
I have an object near at the entrance of the area and I want it to go to that position when I enter the scene from that area, Or if i had a shop, and i left the shop i want to be by the door of the shop.. how would i do this?
Answer by Esa · Feb 09, 2012 at 07:05 AM
You can use dummy/placeholder gameobjects to mark the places and then simply do:
transform.position = dummyGameobject.transform.position;