f

Basing my project on this course has caused my Character to be stuck in Idle among others

functionSam
posted to: Air movement

Hello,I hope you are doing ok!

I'm currently working on my own project that's "fresh" (meaning it's a project not based on the course files) & so far, so good but I've encountered some problems.

Because I've made this project from scratch, I think there's some things missing because at the moment:

  1. My character is stuck in the "Idle" state instead of the "Air" state bug (which was a "bug" that occurred earlier on in the "Player Ground and Air movement" section).
  2. I don't know if it's relevant but in the section "Air movement", Nathan brings up "impulse" as a key in the "message" dictionary, if that's something you can set yourself, that's something I've missed.

This is what I know so far, I wouldn't be surprised I've missed something like a spelling error or something like it but have I missed something more that this course doesn't mention?

EDIT: Removed link to project

This course has been amazing so far in teaching me the fundamentals of Godot, thank you for your hard work!

  • a
    andrewjhaugen replied
    Solution

    List of changes made:
    1) In StateMachine.gd changed line 11 from "func _inti() -> void:" to "func _init() -> void:"
    This was preventing StateMachine from being added to the group "state_machine" because the _init callback was not being called.

    2) In StateMachine.gd changed line 26 from "state.set_physics_process(delta)" to "state.physics_process(delta)" I think maybe auto completion got you here. We want to make sure that when the _physics_process method of the state machine runs that we delegate the call to the state's physics_process method not the state's set_physics_process method

    1 love
  • f
    functionSam replied

    aandrewjhaugen

    For the first one, I should've known that I've misspelled something, which is the usual issue I encounter..

    Secondly, that one I'm unsure I would've spotted myself (unless I went through the tutorials with a comb, maybe?), I think I have a bad habit of missing these kind of things.

    Thank you for spotting these things!

    1 love
  • a
    andrewjhaugen replied

    You're welcome! Great job overall adapting the state machine from scratch to your custom character! Can't wait to see what you end up doing with it.

  • f
    functionSam replied

    aandrewjhaugen

    Thank you for the encouragement, adapting what's taught in the tutorials to what I need is pretty simple since it's pretty much exactly what I need (except for the Hook stuff & mouse movement).

    Right now I'm going to fiddle with some wall jumping stuff, decide if I want double jump or not & after that I'm going to tweak the movement values to what I want for the character.

    The challenge will be the core mechanic I want for the game, which isn't really part of some tutorial & I need to figure out how to integrate it to the current system.

    Again thank you for your help!

    1 love