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 /
This question was closed Aug 13, 2013 at 01:37 AM by TheBlip for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by TheBlip · Aug 13, 2013 at 12:51 AM · objectfunctionfunctionsbce0019member

BCE0019 when using functions

Can someone explain what is wrong with this script? I'm getting the error message: "Assets/Movement.js(38,36): BCE0019: 'point' is not a member of 'Object'. "

  #pragma strict
 var SomePrefab: Transform;
 var dest : Vector3;
 var up : Vector3;
 var lookdest : Vector3;
 var going : Vector3;
 var direction : Vector3;
 var directionreduced : Vector3;
 var getgoingswag : Vector3;
 var destdown : Vector3;
 var ObjectHit : String;
 function Update () {
     var controller : CharacterController = GetComponent(CharacterController);
     if(Input.GetKey(KeyCode.Mouse0)){
         var hit : RaycastHit;
         var ray : Ray = camera.main.ScreenPointToRay (Input.mousePosition);
         Physics.Raycast(ray, hit);
         Debug.DrawRay (ray.origin, ray.direction*20, Color.blue);
         ObjectHit = hit.collider.gameObject.tag;
         if (hit.rigidbody != null){
             MovementSet(hit);
             }
     }
     lookdest = new Vector3(dest.x, transform.position.y, dest.z);
     transform.LookAt(lookdest);
     going = (dest - transform.position)/100;
     direction = new Vector3(going.x,0,going.z);
     var traject : Ray = new Ray(transform.position, direction);
     Debug.DrawRay (traject.origin, traject.direction*10, Color.yellow);
     directionreduced = (traject.GetPoint(10)-transform.position)/100;
     getgoingswag = new Vector3(directionreduced.x,-1,directionreduced.z);
     if (((Mathf.Round(transform.position.x)) != (Mathf.Round(dest.x)))||((Mathf.Round(transform.position.z)) != (Mathf.Round(dest.z)))){
         controller.Move(getgoingswag);}
     
     
 }
 function MovementSet (hit){
             dest = hit.point + up;
             var hit2 : RaycastHit;
             var ray2 : Ray = new Ray(dest+Vector3(0,0.1,0),Vector3(0,-1,0));
             Debug.DrawRay (ray2.origin, ray2.direction*20, Color.black);
             Physics.Raycast(ray2, hit2);
             destdown = hit2.point;
                 if(Input.GetKeyDown(KeyCode.Mouse0)){
                 Instantiate(SomePrefab,destdown,Quaternion.identity);
                 }    
 }
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 Narv · Aug 13, 2013 at 01:05 AM 2
Share

Did you try:

function $$anonymous$$ovementSet( hit : RaycastHit) ?

avatar image TheBlip · Aug 13, 2013 at 01:36 AM 0
Share

Ah, I see what I did wrong. That worked thanks. I'd tried hit : RaycastHit but I put that as in the wrong place as well.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

16 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

Related Questions

The name `PurchaseManager' does not exist in the current context 0 Answers

How do I call a function containing a while loop, inside the update function? 2 Answers

get nearest instance of game object 1 Answer

NullReferenceException: Object reference not set to an instance of an object 1 Answer

Function action applies to every object that have script with that function on it. Help please 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