Error #1009

M4st3rk33n

  • Posts: 6
When I build my game it runs fine.  Howerver when i try to activate one of my behaviour (a behaviour to chop down a tree) I recive this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at MethodInfo-9531()[C:\Users\serba\AppData\Roaming\Stencyl\stencylworks\games-generated\Bob_Must_SurviveBUILD4\Source\scripts\Design_8_8_choptree.hx:105]
   at com.stencyl::Engine/handleCollision()[D:\Programs\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:3016]
   at com.stencyl.models::Actor/innerUpdate()[D:\Programs\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\models\Actor.hx:1539]
   at com.stencyl::Engine/update()[D:\Programs\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2680]
   at com.stencyl::Engine/postUpdate()[D:\Programs\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2836]
   at com.stencyl::Engine/onUpdate()[D:\Programs\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2828]

I tried many fixes but nothing seems to work. Here is a picture of all my scripts withing the chop_thee behaviour:

Justin

  • *
  • Posts: 4506
Your "player" actor attribute hasn't been set.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

M4st3rk33n

  • Posts: 6
it is. it's set to he main character bob in the scene World1

Justin

  • *
  • Posts: 4506
Not exactly sure in that case. Try enabling "Run > View logs through game controller", and open the Game Controller in the toolbar. When your game hits the error, click on the last line in the Game Controller's "Logs" pane, and there should be hyperlinks you can click to jump to the part of your code that caused the error. Perhaps it's something I wouldn't expect.

If it does seem to be one of the blocks that has the "player" attribute, and you can't see why the player attribute is unassigned, feel free to export your project and I can take a look.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)