Scene boundaries?

Hello. I am using the town.zip. how can i create boundaries so that my player doesn’t fall to the emptiness…? :stuck_out_tongue:

Don’t let the players input affect the character outside the level boundaries. So basically, for a circular level heres the pseudo-code:

[java]if(character.getLocation().subtract(levelCenter.getLocation).length()<10){

applyInput();

}else{

character.move(character.lookAt(center.getLocation().mult(0.1));

}[/java]

Well that would freeze them in place when they leave. You also need a force pushing them back in.

@zarch said:
Well that would freeze them in place when they leave. You also need a force pushing them back in.

Okay, true, I changed the example :P

ok thank you… but how can I know the levelcenter and center?

…you put the level there…

I don’t get it normen… sry…

You load the model and attach it to the scene, most probably you also created it in an editor. So you should also know where it is. If you attach it at 10/0/0 and its centered in the editor then 10/0/0 is your center…

i get that… but i dont get all the variables… for ecample what applyIpnut() is??

I dont know how to apply all these in practice… but thx for trying anyway. It shouldnt be that hard though…

applyInput is where you apply your input, I said its pseudo-code :roll: