Hi,
I'm currently working through the spaceshooter tutorial for Makinom and I'm currently at the end of 06 Game Controller.
I'm not getting any errors, and my asteroids are spawning as they should, my ship can fire and the bolts hit the asteroids and disappear but the asteroids don't get destroyed nor does my ship get destroyed when hit by an asteroid.

I've checked the schematics carefully and I can't see anything obvious that I missed. I'm wondering if there's any way to add debugging to the schematics/formula so I can see what's being called/triggered at different points?

Appreciate the tool very much, hoping there might be a clear solution here.
Cheers
  • Make sure the asteroid has the Object Variables component set up as said in tutorial #5 and the bolt has the local start variable set up in the schematic and enabled in the machine as described in tutorial #4.

    Player desctruction is handled in tutorial #8 :)

    As for debugging, you can use the Unity Console node to print information to the Unity console and see what's going on in your schematic.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited April 2019
    Found the issue. Thanks for the feedback and information. Just going to detail my general process here for anyone who comes along afterwards with possibly similar issues.

    So the big picture issue for me was that at this particular point of the space-shooter tutorial I'd just completed 2-3 sections without a clear way to test what I had just built. I'd done the weapons (03), Hit and Destroy (04) part, the Asteroids (05) and the Game Controller (06) but it's not really until the Game Controller is completed that you can put all those parts together and see if they interact correctly.

    For people just starting out that can feel like a lot of places to try and figure out where you might have got something wrong.

    I was lucky. I could at least load the game and get things moving, other schematics I had added to the asteroids were working and my ship was moving and firing. This meant I had a reasonably narrow area of focus. Somewhere between my Hit schematic and my Destroy Schematic something wasn't working.

    My first step was to replace each Hit script (in bolt prefab and each asteroid) with Finished Hit (located in Finished/Schematics) which comes with the downloaded project. When I reloaded the game and tested my ship it actually worked. My bolt was hitting and destroying my asteroids. If that hadn't worked I would have replaced Finished Hit with my original Hit schema and replaced instances of Destroy with Finished Destroy. If that had failed I would have replaced each instance of Hit again with Finished Hit until I got myself a combination that actually worked. The trick is to make it work by any means possible and then replace each part with your own pieces until it breaks again - that then shows you where to focus.

    Luckily I had easily narrowed it to a specific schematic (Hit) but how do I figure out where in the Schematic I got something wrong? Comparing the two schematics (mine and Finished) didn't show anything particularly obvious, and Schematics are quite complex and confusing to start. My solution was to reach for every developers eventual favourite tool - a mass of debug print messages.

    You can right click on each node to Add > Base > Unity Console. Click Edit Text and add a message indicating where in the schematic you are. For success and failure branches try to add which branch you're on. You can add as many Unity Console nodes as you like at any point - they just flow through to your next node without issue.

    Anyway, this pretty quickly allowed me to determine I was calling my Hit script but not getting any further than Init (which was the first message off my Settings node) this indicated I'd messed up a configuration in the first Check Variables (checking for invincibility) node and sure enough I discovered I'd left the Exists property enabled when the tutorial says it should be Disabled.

    I realise this is a lot of information just to get to a what seems like a pretty obvious bug in hindsight, but being able to narrow your focus of relevant context within a tool as complex as Makinom is a useful trait and I thought it likely that others might benefit from my experience.
    Post edited by Steerpike on
Sign In or Register to comment.