Unity Community


Results 1 to 3 of 3

  1. Posts
    130

    MissingFieldException: Field 'System.Single.transform' not found.

    Hallo. I am getting this error for some reason, but do not know why. What I wish to do is to rotate a door on its hinges, as though something is banging it from the other side. Here is the code which I have used:

    Code:  
    1. Function Update ()
    2. {
    3. // Most other code. Things have been defined before this.
    4.  
    5. //When and how the door should move.
    6. if (MonsterIsAttacking == true)
    7. {
    8.  
    9. DoorStageCheck = DoorStage;
    10.  
    11. DoorRand = (Random.Range (0.0, 10.0));
    12. if (DoorStage == true)
    13. {
    14. //TheDoorThatMoves = DoorRand;
    15. TheDoorThatMoves.transform.Rotate(0, 0, TheDoorThatMoves,  Space.Self);
    16. DoorStage = false;
    17. }
    18.  
    19. else
    20. {
    21. TheDoorThatMoves.transform.Rotate(0, 0, -TheDoorThatMoves,  Space.Self);
    22. DoorStage = true;
    23. }
    24.  
    25. }
    26.  
    27. }



    But for some reason, this error occurs each frame:


    MissingFieldException: Field 'System.Single.transform' not found.
    Boo.Lang.Runtime.DynamicDispatching.PropertyDispat cherFactory.FindExtension (IEnumerable`1 candidates)
    Boo.Lang.Runtime.DynamicDispatching.PropertyDispat cherFactory.Create (SetOrGet gos)
    Boo.Lang.Runtime.DynamicDispatching.PropertyDispat cherFactory.CreateGetter ()
    Boo.Lang.Runtime.RuntimeServices.DoCreatePropGetDi spatcher (System.Object target, System.Type type, System.String name)
    Boo.Lang.Runtime.RuntimeServices.CreatePropGetDisp atcher (System.Object target, System.String name)
    Boo.Lang.Runtime.RuntimeServices+<GetProperty>c__A nonStorey14.<>m__9 ()
    Boo.Lang.Runtime.DynamicDispatching.DispatcherCach e.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFact ory factory)
    Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFact ory factory)
    Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFact ory factory)
    Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
    UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
    Any ideas?

    Edit... Actually... The more I think about it, the more an animation appears suitable... Lets see...
    Last edited by sereda008; 04-28-2012 at 09:42 AM.
    My beginner's guide to create a video game http://create-a-videogame.blogspot.com/


  2. Location
    Denmark
    Posts
    423
    hm. IT doesn't tell you the line number?

    Have your assigned a gameobject to "TheDoorThatMoves"?
    My First Game - Looking for Feedback

    A game is a series of interesting choices.
    - Sid Meier


  3. Posts
    130
    Hey... It appears that TheDoorThatMoves is an integer! Now this is a surprise. Lets see... Hmm... The more I think about this, the more cheap it appears... Indeed, perhaps an animation would have been better. Anyway, thanks for the help
    Last edited by sereda008; 04-28-2012 at 10:35 AM.
    My beginner's guide to create a video game http://create-a-videogame.blogspot.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •