N
NeZvers
Guest
I have a game master object that is creating controller objects and player objects in Room Start event but for some reason, It doesn't change needed variables (they stay as they are defined by default). All I need it to toggle what inputs controllers should respond.
I don't get it, I thought that's how you can tweak created objects.
I don't get it, I thought that's how you can tweak created objects.
Code:
/// SPAWN CONTROLLERS & PLAYERS
var controller1 = instance_create(x,y,par_controller);
var sp = instance_find(oSpawn, irandom(instance_number(oSpawn) - 1));
var p1 = instance_create(sp.x,sp.y,obj_player);
// Doesn't work like this
p1.controller = controller1;
p1.character = global.player1character;
p1.touchCtrl = 0;
p1.keyboardCtrl = 0;
p1.gamepadCtrl = 1;
p1.gamepadIndex = 0;
obj_display_manager.target = p1;
while(sp.x == p1.x && sp.y == p1.y){
sp = instance_find(oSpawn, irandom(instance_number(oSpawn) - 1));
}
var controller2 = instance_create(x,y,par_controller);
var p2 = instance_create(sp.x,sp.y,obj_player);
// And doesn't work like this
with(p2){
controller = controller2;
character = global.player1character;
touchCtrl = 0;
gamepadCtrl = 0;
keyboardCtrl = 1;
gamepadIndex = 1;
}
Last edited: