Skip navigation
Currently Being Moderated

Character falls through the ground

Apr 12, 2013 11:20 AM

Tags: #flash #as3 #3 #actionscript #game #platform #hittestproblem #gravity

I have created gravity in a little platform game, and it works, however my character ignores all the hitTest code and falls through the floor... and I can't move her because she then just disappears... How do I preven her from faling through the ground so I can actually move her around the screen..


I'm using as3 in Flash CS6


Any help would be greatly appreciated 



  • Currently Being Moderated
    Apr 12, 2013 11:34 AM   in reply to Bombza

    Show the relevant hitTest code and indicate where it doesn't appear to obey what you think it should.

    Mark as:
  • Currently Being Moderated
    Apr 15, 2013 7:17 PM   in reply to Bombza

    Why don't you just use the hitTestObject() method?


    Are you sure that your array holds anything.  Try tracing it to make sure.


    There is no code there to move the girl in the x direction,.

    Mark as:
  • Currently Being Moderated
    Apr 15, 2013 11:39 PM   in reply to Bombza

    Make sure that you put the the relevant hitTest Logic inside an Enter_frame Event listener and that you attach that listener to the stage, make also sure you have access to stage when you do that.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points