Hello,
I want my player to be able to go to the previous view by pressing Q.
The way I'm doing it is:
1. Trigger constantly checks if it collides with a player.
2. If it collides, and the Q key is pressed, the trigger changes the player and teleports it to a different place with a new camera.
Pictures: https://ibb.co/r5x7hdm , https://ibb.co/fC8ckM7
It works well, but sometimes it simply does not react. I assume it is a frame-rate issue.
Is there a better way to achieve this functionality?
thank you for the amazing tool!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Could well be, as the frame that the keypress is detected may fall on the Engine: Wait Action.
Generally I'd recommend caution when doing so, but you should find it more reliable if you do without this Action and just loop Input: Check on itself.
The other way to detect input is to define an Active Input, which is an ActionList that runs when a given input is detected. You should be OK without them in this case, but more details on their usage can be found in the Manual's "Active Inputs" chapter.
Maybe I misunderstood how to use the active input but that's what I did.
I used two active inputs to set a global var (isBackPressed) if the key is pressed or not. I check that var and execute the logic on the same continuous trigger. It works in some places well, but I have a scene where it works only if I press long enough, so it looks like the same issue.
I don't even know what in the scene could possibly influence that those triggers.
Not sure how else to use the active input action list if I have multiple local references.
(I checked if the player collides all the time with the trigger.
I removed all the engine waits.)
Did you try the Input: Check Action with a removed Engine: Wait?
The intended way to use Active Inputs is to have the Active Input's ActionList run the sequence you want to play - i.e. from the Variable: Check onwards in your original list.
One other approach you could try is to have the Active Input's ActionList consist of a single ActionList: Run Action that runs an in-scene list. Override the ActionList to run field with a GameObject parameter. If you then move the "proper" Actions that should run after the input is pressed to a new Cutscene, you can then set the parameter to that cutscene using the ActionList: Set parameter Action. This'd typically be run at the same time as the Input: Toggle active Action is run to turn the Active Input on.
After trying a couple of things I don't think it is a logic issue because the same Action List works just fine with other close-ups in the scene. I used the same logic on a hotspot, and it works. I can leave the shot like that. It seems there is a problem with those specific close-ups or the scene in general.
Which logic - the use of Input: Check?
Check that no gameplay-blocking ActionLists are running at the time. You can do this by enabling the AC Status box at the bottom of the Settings Manager.
Ok, will do. I learn today that it might be a performance issue related to art assets. I'm using experimental svg renderer and it could cause frame drops. So I will optimize the scene and see if that is the issue.