I have been working on a game and in that i want to repeat my environment continuously when my character moves. I want that in such a way that user feels its an endless environment and keep facing enemies continuously.
I tried the type of endzone logic implemented in TunnelRunner tutorial but i am feeling a jerkiness in the environment. Actually in TunnelRunner they are just loading the level again and again after the EndZone is reached.
How can i achieve this functionality?
i have two propositions in my mind:
1. To make the camera transform back to its original position(but i think it would make jerkiness). 2. To instantiate prefabs of my particaular model(that i want to repeat) time to time in my environment.
But i think there would be some other way also to implement this.
Please help!
Thanks
Do you want your environment to wrap around, or do you want it to be endless (and probably randomly generated)? The two things are different, and mutually exclusive.
For an endless, random landscape you could instantiate prefabs / or recycle existing objects randomly in front of your camera (but out of visible range). There would be no need to reset the position of the camera in this case.
Thanks recluse for your reply.
Infact i was also thinking the same way of creating an endless environment by instantiating the objects from time to time.
But then i think there would be a problem. The world coordinate positions of every character would become very large as the game proceeds.
Don’t you think so?
You could always try making every object in the game (including the player) the children of an empty object whose transform is constantly moving back to 0,0,0.