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 hijsm · Mar 09, 2012 at 10:11 PM · animationresetsendmessagewalkingidle

SendMessage walk has no recieveer

hello, I am having a problem with some SendMessages, i have one for walk, one for reset and for gotHit, those are my only Sendmessages and they all say the same: SendMessage ... has no reciever. hat i am trying to do here is to make the AI stop with his walking animation if he stops.

code for walk and reset:

 var model : Transform;

function Start(){

 walk();

}

function reset(){

 model.animation.CrossFade("idle");

}

function walk(){

 model.animation.Play("walk");

}

and here i send the message

 if(velocity>0)
     transform.SendMessage("walk");
 else
     transform.SendMessage("reset");





and for gotHit it is pretty much the same

please help me.

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

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Berenger · Mar 09, 2012 at 11:23 PM

That should work. Are you sure the Transform your sending the message to (btw, it is the Transform of the script with "if( velocity ...)") has the script with walk and co functions ?

Comment
Add comment · 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
0

Answer by rutter · Mar 09, 2012 at 11:26 PM

GameObject.SendMessage()

If you call SendMessage("Walk") on a GameObject named "Sally" and get a message saying there was no receiver, that implies there is no script attached to Sally which has an appropriate function to call.

Is the script sending the message attached to the same GameObject as the one you're hoping will receive it?

Comment
Add comment · Show 1 · 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 hijsm · Mar 10, 2012 at 07:22 AM 0
Share

Sort of, it is attached to one of its childs (the function walk and reset is a child of the Send$$anonymous$$essage)

avatar image
0

Answer by hijsm · Mar 10, 2012 at 09:47 AM

I am following it from a tutorial on youtube and h had it in the exact same way and it woked for him. heres te link link text

Comment
Add comment · 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
0

Answer by hijsm · Mar 10, 2012 at 09:47 AM

Oh, i already got it, I pasted the script on the wrong GameObject, thanks rutter. though I still get the error of gotHit, but I will take a look at that because i did not jet do that

Comment
Add comment · 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

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

6 People are following this question.

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

Related Questions

Player plays walking animation if I press a and d at the same time while standing still 2 Answers

try to make my own character control with animation like- running, walk, idle. So need help and guideline how to do or start 0 Answers

Can I make animations snap to a frame? 1 Answer

Changing speed of running animation 1 Answer

timer that can be reset 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