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 /
This question was closed Jan 27, 2017 at 10:22 PM by Trevdevs for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by Trevdevs · Jan 27, 2017 at 09:39 PM · 2dphysics2d gamecharacter controller

CharacterController 2D Move called on inactive controller but it is active...

This should not be that hard but for some reason it is, or am I forgetting how character controllers work?

This error makes no sense the controller is indeed active

The only components on the object are Transform(obviously), a sprite renderer, this script, and a character controller.

Any help would be much appreciated, i'm sure its something stupid i just missed though :)

Here is the script, and according to it line 35 is the issue

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class MoveByClick : MonoBehaviour {
 
     //Transform to move
     public CharacterController objectX;
 
     //Vector2 data
     private Vector2 targetPos;
     private Vector2 dir;
     private Vector2 movement;
 
     //How fast does the object move
     public int speed;
 
     //Camera to use
     public Camera camera;
 
     void Update()
     {
         if(Input.GetMouseButtonDown (0))
         {
             targetPos = camera.ScreenToWorldPoint (Input.mousePosition);
             dir = targetPos - (Vector2)objectX.transform.position;
             movement = dir.normalized * speed * Time.deltaTime;
         }
 
         if(movement.magnitude > dir.magnitude)
         {
             movement = dir;
         }
 
         objectX.Move (movement);
     }
 }
Comment
Add comment · Show 9
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 FortisVenaliter · Jan 27, 2017 at 09:46 PM 0
Share

What is the exact text of the error?

avatar image Trevdevs FortisVenaliter · Jan 27, 2017 at 09:48 PM 0
Share

CharacterController.$$anonymous$$ove called on inactive controller UnityEngine.CharacterController:$$anonymous$$ove(Vector3) $$anonymous$$oveByClick:Update() (at Assets/Scripts/$$anonymous$$oveByClick.cs:35)

avatar image FortisVenaliter Trevdevs · Jan 27, 2017 at 09:52 PM 0
Share

Is it possible this was called before the Controller got Start() called?

If not, can you post a screenshot of the inspector for the object while in play mode?

Show more comments
avatar image Trevdevs · Jan 27, 2017 at 10:03 PM 0
Share

Wouldn't let me reply so gotta post here.

I never imported CharacterController it's just a component that has always been there, so does that mean it's outdated for this version of unity?

avatar image FortisVenaliter Trevdevs · Jan 27, 2017 at 10:08 PM 1
Share

Hmm... never $$anonymous$$d. It might just be that you're using a 3D character controller on a 2D object? $$anonymous$$ight look here for more information.

avatar image Trevdevs FortisVenaliter · Jan 27, 2017 at 10:10 PM 0
Share

Guess I could just do the old fanshioned rigidbody2d addforce then, if charactercontrollers aren't "compatible" with 2d object don't really see why they wouldn't though.

Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

131 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 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 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 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 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

Physics2D Overlapbox not working as aspected 0 Answers

Why is there no Rigidbody2D.SweepTest() ? 1 Answer

Stop jump animation 1 Answer

how to throwing/flick gameObject in 2D 1 Answer

Simulating a trajectory that takes collisions into account 2 Answers


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