Don’t Touch The Spikes Part 1 Home / Courses / Phaser / Don’t Touch The Spikes Part 1 Set Up Game Setting Up The Game Core Loop Add The Bird Animation Set Up Physics Add Input and Flapping Bouncing off the Wall Spikes Part 1 – Adding Spikes Part 2 – Place on Wall Spikes Part 3 – Randomizing Spikes Part 4 – Animating Top And Bottom Spikes Collisions Don’t Touch The Spikes Part 1 Back to Course This content is protected, please login and enroll course to view this content! Prev Animation Next Add Input and Flapping 9 thoughts on “Set Up Physics” gmich_ April 14, 2020 at 5:11 am why on the step set up physics my code error.. Uncaught TypeError: Cannot read property ‘setGravityY’ of null.. this.bird.body =null Reply William April 14, 2020 at 5:32 am First, make sure you have physics enabled. Is there a box around the bird? Reply MyFault June 16, 2020 at 7:58 am I get the same error as gmich_. I don’t have a box around the bird but my template also seems to be a bit different than what you are showing in the vid. Some of it looks the same but I did not have the commented out physics portion in mine. Is there a newer version of your template? I also noticed in the previous video, the code you have to copy isn’t quite the same as what you did in the video? Reply William June 16, 2020 at 10:47 am It is possible there is a version I neglected to upload. I’ll just upload the latest now to but sure. What code do you mean? Reply William June 16, 2020 at 10:54 am I’ve updated it to version 3.1.3 This should work for anything in the videos https://phasergames.com/downloads/ultimate-game-parts-template-for-phaser-3-2/ Sorry for any frustration this may have caused. Reply MyFault June 16, 2020 at 11:26 am Hmmm, sadly I still get the same error. One thing I did notice is when I hover over the “this.bird = this.placeImage” it shows the method but it does not show the “physics?” part of the method, it ends at “scale: any” When I then go to baseScene.js, it only shows “placeImage(key, pos, scale)” Could that be why there is an issue? Reply William June 16, 2020 at 11:43 am Yes, that would certainly mess things up. As soon as I saw your post I realized that I had uploaded from the laptop which had older files on it. *facepalm* Here are the correct files. https://phasergames.com/wp-content/uploads/edd/2020/06/UT3.zip Reply MyFault June 16, 2020 at 11:52 am BOOM, we have liftoff…errr… I mean…we have a, dropping through gravity, bird!!! Thanks so much for taking the time to help get this sorted. I look forward to finishing this course tomorrow Reply William June 22, 2020 at 11:42 am No problem! Reply Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment Name* Email* Website Save my name, email, and website in this browser for the next time I comment.