Hey,
following Problem:
while playing, i press keys and buttons to control my object to the finish-area. As soon as i reach it, i change the state and set the focus to false.
But when i restart the level, the keys, which where pressed in the end, are still pressed, and the object is handling a “ghost”input. Same thing with the buttons.
Also, the forces applied to the object at the end (force/torque), also get applied instantly at restart. how can i reset them?
here is my “finished” state, if it helps anyone:
State {
name: "finished"
PropertyChanges { target: mainMenu; visible: false}
PropertyChanges { target: level; visible: false}
PropertyChanges { target: level; levelSource:""}
PropertyChanges { target: finishMenu; visible: true}
PropertyChanges { target: buttonarea; visible: false}
PropertyChanges { target: scene; focus: false; }
PropertyChanges { target: scene; Keys.forwardTo: [scene]}
StateChangeScript {
script: {
Keys.enabled = false
}
}
}
and here is the game-state:
State {
name: "game"
PropertyChanges {
target: level.space_ship
x: level.space_ship_x
y: level.space_ship_y
}
PropertyChanges { target: mainMenu; visible: false}
PropertyChanges { target: level; visible: true}
PropertyChanges { target: level; levelSource: "levels/Level02.qml"}
PropertyChanges { target: finishMenu; visible: false}
PropertyChanges { target: buttonarea; visible: true}
PropertyChanges { target: scene; focus: true; }
PropertyChanges { target: scene; Keys.forwardTo: [level.space_ship.controller]}
StateChangeScript {
script: {
// Pause the physicsWorld
//level.world.running = true
}
}
},
Hoping, someone has a solution for this… gonna check the demos once more, if i can find the solution..
Cheers,
TS