Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by oooooooooott · Oct 16, 2014 at 12:00 AM · gameobjectimagesendmessagereceiver

Message not being recieved

I have a gameobject, and two images: the inventory, the inventory slot, and the slot icon image. The inventory sends a message to the slot every update:

         item1 = inv[0];
         Slot1.SendMessage ("recieveContentData", item1);
         item2 = inv[1];
         Slot2.SendMessage ("recieveContentData", item2);
         item3 = inv[2];
         Slot3.SendMessage ("recieveContentData", item3);
         item4 = inv[3];
         Slot4.SendMessage ("recieveContentData", item4);



The slot receives this message:

     public void receiveContentData(Item newContents)
     {
         contents = newContents;
     }




And then, every update, tells the slot icon to change it's image to that of the item, contents.

         if (contents != null)
         {
             itemImage.enabled = true;
             itemImage.sprite = contents.itemsprite;
         }
         else
         {
             itemImage.sprite = null;
             itemImage.enabled = false;
         }
     }



The problem is, when I run this script, apparently there is no receiver to this message;
Even though I assigned all of the Slot variables to gameobjects with the slot script attached, and all of the slots have a Slot icon image as children. Here is the exact error message:

 SendMessage recieveContentData has no receiver!
 UnityEngine.GameObject:SendMessage(String, Object)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by c00pala · Oct 16, 2014 at 12:29 AM

Check the spelling of Receiver - The I and E are different in the send message and the function - assuming the code has been copy/pasted?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image oooooooooott · Oct 16, 2014 at 12:35 AM 0
Share

Aw, crap. I messed up big there. Sorry for wasting your time. XD

avatar image c00pala · Oct 16, 2014 at 12:59 AM 0
Share

No issues at all, mate. At least it's an easy fix for ya. =)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

29 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

SendMessage has no receiver BUT the GO definitely has a script on with that function in it? 1 Answer

How do you place an image on an object so that the object size is based on pixels per unit and image size? 1 Answer

How do I catch the SendMessage Has No Reciever exception thrown when I try to run a function with SendMessage that does not exist? 1 Answer

Block GameObject from reciving SendMessage 1 Answer

How to display a file name on a text field c# 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges