How to keep "require" local?

Let’s say I have two scenes.

Outside_Map.lua

Inside_Map.lua
Outside_Map has a player_system.lua that contains functions like initPlayer(), movePlayer() and has implemented small animation player sprites.

Inside_Map has a player_system_big.lua that contains the same functions like initPlayer(), movePlayer() and has implemented big animation player sprites.

Starting the game with Outside_Map, the player is a small sprite, when he goes to Inside_Map, he has a big sprite, now when he goes outside back to the Outside_Map, he is using player_system_big.lua functions?

Any way I can solve this? [import]uid: 49300 topic_id: 28251 reply_id: 328251[/import]

Just wondering why player_system_big.lua is traveling over to Outside_Map.lua

I have also tried to use

[lua]local player_system = require “player_system”[/lua]

and

[lua]local player_system_big = require “player_system_big”[/lua]

But it still travels through!

These files just contains functions to keep me more organized that’s all. [import]uid: 49300 topic_id: 28251 reply_id: 114143[/import]

Way, way too hard to tell you without combing through your code but I think it sounds like you might not be deleting and recreating the character when he goes back outside, possibly? [import]uid: 52491 topic_id: 28251 reply_id: 114197[/import]