Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Little Help?

Hello, Everyone. I'm using Blizzard's ABS. When I'm using a skill it's start to crash and show a error message

Script"<script name here> line 6982: Nomethoderror occurred undefined method `color' for nill:Class

Here's the code
Code:
def update_select
    # if normal blink should be processed
    if @select == 2
      # set blink
      @sprite.blink_on
    # if selected right now
    elsif @select == 1
      # set color with new alpha
      @sprite.color.set(0, 255, 0, (8-Graphics.frame_count%16).abs*24)
    else
      # set to no color
      @sprite.color.set(0, 0, 0, 0)
    end
  end
  #-----------------------------

What I did wrong. Can anyone help me??  :'(
 

khmp

Sponsor

You are getting that error because the @sprite object is nil. Trace the variable to where it is supposedly created. It is failing to initialize for some reason.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top