Forum rules - please read before posting.

Action that simulates a Trigger's "Cancels interactions?" property?

In the final straight for our game, an obscure bug unearthed by one our beta testers has me stumped.

The game has a map, it's a UnityUI menu that pauses the game when open. On the map, the player can click a location they've already visited to fast travel there. That's a button menu element that runs an actionlist set to block gameplay and "unfreeze pause menus"; without the latter they don't work at all.

When the player clicks a location, the camera fades, the map closes and we Scene:Switch to the new location.

The problem occurs if the player was moving (it's point and click movement style btw) when the game paused to show the map. As the camera fades, the game unpauses and the character continues to move for a second or so. This looks a little strange, but it's not the real bug: If the player was moving as part of moving to a marker to activate a hotspot, and they're close enough that they reach said marker before the camera fades out, the actionlist triggers, and can supersede the map teleport.

A practical example: The player is inside a building, and can click on the exit to leave it and go outside. They click the exit and begin walking toward it. They then open the map and select a location to teleport to. As the camera fades, they continue walking and reach the walkto marker for exiting the building. The scene changes, and the player is outside the building, not at the location they chose to teleport to.

I've experimented with a number of ways to stop the player moving when the map is opened or when a fast travel location is selected, but I've been unable to make anything work. The trigger script has that "Cancels interactions" field, and I wonder, is there a way to put a (custom?) action in one of these lists that cancels any interaction that was running?

Comments

  • Through script, you can command the Player to cancel their movement - and pending interaction - towards the last-clicked Hotspot, with:

    AC.KickStarter.playerInteraction.StopMovingToHotspot ();
    

    However, this command should be called automatically by the Character: Move along path Action is used to affect the Player with the Stop Moving method. Try preceding your map location ActionList's Actions with this.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.