Forum rules - please read before posting.

Fishing minigame

Hi!
Im trying to make a minigame where you fish.
I made the fishing line to a player so that you can click where to fish.
I put an objekt over the fishing-hook as a child and tag´d it with krook
then i put an trigger over the animated fish´s mouth. <--the trigger actionlist= remove aborreobjekt
and set it to react to any object with the tag krook

but it dosn´t work...

What is the best way to accomplish this?

https://imgur.com/uFWlzDD

MalteMP

Comments

  • What's the selected object in the screenshot? The fish? As the object names aren't in English I'm afraid I don't know what I'm looking at here.

    Let's see the Trigger object, as well as the object with the "krook" tag.

    The Trigger's default Detection method is Rigidbody Collision, which requires that both the Trigger and the object it's detecting have 2D Colliders, and that the colliding object has a Rigidbody2D component.

    The Rigidbody2D is best attached on the player's root, and it may be easier to have the Trigger detect the player instead.

    The other detection method is Transform Position, which doesn't require a Rigidbody2D, not a Collider on the object it's trying to detect - as it works by checking the object's origin against the boundary of the Trigger itself.

    See the Manual's "Triggers" chapter for more on this method. This method requires you to assign exact objects (not tags) for it to detect, but the Player object itself can be present in the scene file - it doesn't have to be spawned by the Settings Manager. A "local" Player object will override the default.

  • edited September 2019

    @ChrisIceBox Here is some better images, and i renamed everything to english.

    bass
    https://imgur.com/uKNwtvw

    bass trigger
    https://imgur.com/Mjly25v

    hook
    https://imgur.com/YEMTeCn

    video
    https://imgur.com/9Y7o9Zl

    thank you so much for answering!
    malteMP

  • i now also added a box collider 2d to the hook objekt inside fishingrodplayer prefab.

  • edited September 2019

    i now also added a box collider 2d to the hook objekt inside fishingrodplayer prefab.

    And what difference did that make?

    Unless your "hook" object is falling due to the Rigidbody, I can't see what might be wrong - recreating the same setup from your images doesn't cause such an issue on my end.

    Your Trigger's position does seem to be some distance away from the root, however - the screenshots don't show the actual location of its Box Collider in the scene.

    Again though, I would recommend using the "Transform Position" method of Trigger Detection as this does without the need for any of the physics comonents on the Hook object.

    Give it a go, but if you really are stuck - PM me the scene file along with your Player prefab and I'll take a look.

  • I deleted the player and the fish and re-did those and now it works as you can see in the video... The trigger attached to the fish collides with the circle collider on the player.
    video;
    https://imgur.com/jVrthY1

    but,
    i don´t get why the scene-switch dosn´t work. do you see what the problem is?

    build settings
    https://imgur.com/Hf2BggM

    player prefab
    https://imgur.com/j79dnMF

    scene with fishes
    https://imgur.com/6HAsLCF

    trigger
    https://imgur.com/Al2qDk8

    bass trigger actionlisteditor
    https://imgur.com/sd6Bnlf

    gädda (pike) actionlisteditor
    https://imgur.com/UsgYfFd

    mört (roach)
    https://imgur.com/ixPKG0w

  • edited October 2019

    Nothing in the screenshots shows an issue - so long as the Scene: Switch Action is run, it should change scene. Is this only a problem here, or do other scene-switches not work either?

    Do you get any message in the Console relating to this when it should do so? What is your AC version number? Though it shouldn't make a difference, try removing the deleted scene from the top of the build settings.

    You can check if any Action is actually being run by enabling comments for it. Click the icon to the top-right of the Action, and enable Comments for it. Type in something into the yellow box (e..g "Switch scene now"), and enable comments in the Console via the bottom of the Settings Manager. Does this comment show at the correct time?

    Be aware also that it's better practice to rely on a separate ActionList if you want to re-run the same set of Actions from different objects. Your bass, pike and roach ActionLists all share the same Actions (starting from Object: Check presence). It would be best to move these shared Actions to a new Cutscene, and then have each fish ActionList run this Cutscene after their unique Object: Add or remove Action. That way, you can make changes to e.g. the Scene: Switch Action in a single Cutscene without having to update three ActionLists instead.

  • AC verison= 1.69.0

    i have a couple other SceneSwitch that work just like they should in the game. and the scene switch to this scene (from mössenscene to minigame3) also works.

    i removed the deleted scene from the build.

    the PlayOneShot-sound and the animation that is right before the SceneSwitch plays, so i dont get why the SceneSwitch dosn´t play...

    theese two are the only log messages im getting.
    PlayerPrefs Key 'AC_Mössen_0' loaded
    Comp 4_00000 cannot find Sorting Map to follow!

    it dosn´t seem like the SceneSwitch is able to play at all.
    https://imgur.com/6uhKmv2

    can it have something to do with animation?
    https://imgur.com/FoBVwtA

    A separate Actionlist would have been a lot simpler. Thanks.

  • No, the Actions are fine - and the animation shouldn't affect it.

    Is this occuring when starting the game from this scene, or are you starting the game from an earlier scene?

    Let's see a screenshot of your Settings Manager's "Scene loading" settings.

  • Ok,
    The same thing happens if i start from minigame3 or if i start from mössensscene(my main scene) and then enter minigame3 via a SceneSwitch.

    settingsmanager 1
    https://imgur.com/pI5cHPE

    settingsmanager 2
    https://imgur.com/7Gj8rt6

  • I can try send you the project file if you cant find something in the settings manager?

  • Let's try one more attempt at debugging. I'll PM you a modified version of the SceneChanger.cs script - this is found in your /AdventureCreator/Scripts/Game engine directory. Temporarily replace it with the modified file and share a screenshot of the Console after attempting the scene change when starting from minigame3. It won't fix the issue, but should reveal where the issue is coming from.

  • It dosn´t seem to show anything new from before...
    https://imgur.com/TWOkb7m

    Maybe i have to redo the the objects and actions and see if that fixes anything...

    /sorry for taking up your time,'
    i dont know how i managed to create this sneaky bug...

  • Apologies - I was mistaken. This is related to the animation, not the script I mentioned earlier.

    Your previous Object: Animate Action is set to wait until the "itemsfiskaranimation" clip has finished playing, but this completion isn't registering for some reason.

    Check the Animator when this occurs. Is this clip being played correctly to completion? A "quick fix" would be to uncheck the Action's Wait until finish? field, and insert an Engine: Wait Action set to wait the same duration as the animation clip.

  • edited October 2019

    Okey!,
    i recorded so that you can see the animator simultaneously.

    the quickfix does not seem to have any effect.

    Video
    https://imgur.com/qdGWSMz

    picture of quickfix
    https://imgur.com/kXC9Hnf

    I just tried this, and it switched scene.

    picture
    https://imgur.com/SWM3IVW

  • What's your Unity version, and let's see a screenshot of the transition's properties (from "itemsfiskaranimation" back to the default.

    Also, temporarily mute this transition - does the Action then complete?

  • unity version; 2018.3.5f1 Pesonal-
    I edited my last comment and added a new picture.

    if i mute the transition the "itemsfiskaranimation" just keeps looping.

    transition
    https://imgur.com/ECBHhrI

  • Thank you, I will attempt a recreation.

    You can prevent the looping by selecting the animation clip's asset file and unchecking "Loop Time" in its Inspector.

  • I'm afraid I can't reproduce the issue. Is the animation state it's transitioning to after playback mapped to an animation, or is it empty?

    It may be necessary to see the files for myself if you're willing, but I should only need the single scene file, Animator, animation clips and sprites associated with the animation - not the project itself.

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.