Forum rules - please read before posting.

[Bug] When player prefab is selected and play

Hello,

When the player prefab is selected from its "Resources" folder, and then you click play in the Editor a few things happen:

1. The camera cannot find the player anylonger, because the player does not exist (looks like it does not spawn)
2. Console log errors:

- !CompareApproximately (aScalar, 0.0F)
UnityEngine.Quaternion:Lerp(Quaternion, Quaternion, Single)
AC.GameCameraThirdPerson:UpdateSelf() (at Assets/AdventureCreator/Scripts/Camera/GameCameraThirdPerson.cs:199)
AC.GameCameraThirdPerson:_Update() (at Assets/AdventureCreator/Scripts/Camera/GameCameraThirdPerson.cs:183)
AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:344)


- transform.rotation assign attempt for 'TopDownPlayerCamera' is not valid. Input rotation is { NaN, NaN, NaN, NaN }.
UnityEngine.Transform:set_rotation(Quaternion)
AC.GameCameraThirdPerson:UpdateSelf() (at Assets/AdventureCreator/Scripts/Camera/GameCameraThirdPerson.cs:199)
AC.GameCameraThirdPerson:_Update() (at Assets/AdventureCreator/Scripts/Camera/GameCameraThirdPerson.cs:183)
AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:344)


Why does this happen? Is it a Untiy bug or?


NOTE: "Player" Prefab has FSM objects (PlayMaker)

Thank you.

V 1.50i

Comments

  • Looks unrelated to PlayMaker.  However, I can't recreate this on my end - therefore, please try the following change to the GameCameraThirdPerson.cs file:

    Insert the following line into line 122 (just below "base.Awake ();":

    targetRotation
     = transform.rotation;

    Does that remove the error?
  • That certainly cleared up the 3 errors in the console,however the character still is not spawned.

    As you've stated you cannot re create this on your end, therefore it must be from another asset.

    I also have hierarchy2 which might be the reason. - I will test this in the future.

    Anyhow, since this is not caused by AC I will just simply have to de-select the prefab prior to playing.

    Thanks appreciate the support.
  • I just wanted to let you know that with the new update this error does not persist.

    Instead I get the message of the possibly unity hidden bug :)
  • Sorry - is the bug still there or not?  If you're getting a message, where is it and what does it say?
  • With the previous version the error on original thread persisted, with the new update the player does in fact appear in the scene and I get no errors, only a warning console message as stated above.

  • But what is the console message, exactly?
  • Yes sorry, was not at the workstation when I responded.

    Player clone found in scene – this may have been hidden by a Unity bug, and has been destroyed.

    —————————–
    UnityEngine.Debug:LogWarning(Object, Object)
    AC.ACDebug:LogWarning(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:26)
    AC.KickStarter:OnAwake() (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:871)
    AC.MultiSceneChecker:Awake() (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:30)

  • OK, thanks.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.