AndrewBGS
Member
|
Element out of range
So I noticed some more people encountered this error, but I couldn't find a proper way to fix it. Apparently this occurs when the element you are looking for is outside the active range.
Precisely, I have a PLAYER object, and I want to place my camera on him.
IF the player is too far from the "start of the world", I get the element out of range error. If I place the player close to the "start of the world" (the place where the axis are visible) it all works smooth.
I can handle this for testing, but when it will be a game and the guy will save to far from the tarting point, I'm doomed.
so, how can I convince my camera to shift itself to the place the player is?
|
|
03-20-2013 08:41 AM |
|
fatcoder
Member
|
RE: Element out of range
You will want to save the camera's location. Then when loading a game, move the camera to this location and allow the world to update. You should then be able to reference your player and place the camera on him.
|
|
03-20-2013 01:25 PM |
|
Esenthel
Administrator
|
RE: Element out of range
to setup initial camera position you can use waypoints in the world, and set camera from custom waypoint potision next to player.
Always check for: if(Players.elms())Players[0].
|
|
03-20-2013 05:55 PM |
|
AndrewBGS
Member
|
RE: Element out of range
Ok, I think this is half way helping.
I do perform the checking, that is not the problem. If I translate (move the character around) near the (0,0,0) coordonates it's all fine. The same object, moved further away, will break the program.
So I'll try the waypoint solution, hope it works, but how do I set the camera to a custom waypoint? Is there a tutorial on that also?
PS: Thanks fatcoder, that should take care of half my problem
(This post was last modified: 03-22-2013 01:51 PM by AndrewBGS.)
|
|
03-22-2013 01:50 PM |
|