Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 GrantFleming · Mar 17, 2017 at 10:02 PM · c#scripting problemastarusingrequirecomponent

[FIXED] 2D Platformer – The name Seeker does not exist in current context

Hi All,

Firstly thank you for taking the time to look at my question.

I'm new to making games and Unity and I'm currently working my way through a 2D platformer tutorial and I've hit a snag I can't solve.

When I try to create a new Seeker object from the Astrostar I'm getting the following error:

alt text

Here is my code:

 using UnityEngine;
 using Pathfinding;
 
 [RequireComponent (typeof(Rigidbody2D))]
 [RequireComponent (typeof (Seeker))]
 
 public class EnemyAI : MonoBehaviour {
 
     public Transform target;
     public float updateRate = 2; //times per second
 
     private Seeker seeker;
     private Rigidbody2D rb;
 
     //The calculated path
     public Path path;
 
     //The AI's speed per second
     public float speed = 300f;
 
 } 

I'm not sure whether it's related but I have another few error messages that have popped up today that weren't there when I was working yesterday. I cannot work out for the life of me what I did to incur these. Despite these messages the game still works as it did yesterday.

alt text

Thanks in advance for any advice you can offer!

screen-shot-2017-03-17-at-161724.jpg (18.4 kB)
screen-shot-2017-03-17-at-162103.jpg (111.9 kB)
Comment
Add comment · Show 2
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 nathanthesnooper · Mar 18, 2017 at 03:39 AM 0
Share

"Seeker" probably doesn't exist in the Pathfinding class... If you are watching a tutorial it is probably updated class. I would either do pathfinding yourself or type Pathfinding. and looking at your options. Chances are the developer renamed it or un-capitalized it.

avatar image GrantFleming nathanthesnooper · Mar 18, 2017 at 11:10 AM 0
Share

I did think that but I found the Seeker class. I can actually add it as a component to my GameObject. I'm confused as to why I can add it to my GameObject but not use it as a type for a variable in my own script on the same GameObject.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by hexagonius · Mar 18, 2017 at 11:15 AM

looks to me is if mono or vs, whatever you're using, is out of sync with the project. otherwise unity would show the same error. in unity go you Edit -> Open C# Project. if that does not help you could also delete the IDE related files from your unity project folder while it's closed and open it again

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 GrantFleming · Mar 18, 2017 at 11:30 AM 0
Share

At that fixed it THAN$$anonymous$$ YOU @hexagonius that was frustrating me! I am completely new to unity and C# and I thought I had made a nooby syntax error or something! Opening the full C# project has completely fixed this.

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

8 People are following this question.

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

Related Questions

myObjetc..GetType().GetCustomAttributes(typeof(RequireComponent) not working correctly 1 Answer

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

A* Pathfinding on click? 0 Answers

Adding a delay for weapon switching 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