edited September 2014 in General Discussion
Hello Everyone,

I'm working on ORK Tutorials and I was doing the "Cinematic field scene introduction" where you set some waypoints to animate the camera when the player first enters the fields.
Anyway, I thought I can extend this part of the tutorial by calling a function on an another camera asset that I have. Camera Path Animator.

So I set up the Game Event to call the "Play" function of the "CameraPathAnimator" component. But it doesn't work. I'm not even sure, if I'm getting a reference of the component.

I tried the "target object" to be a prefab and added it to the Event Settings node.
I tried adding "CameraPathAnimator" to the gameobject that holds event interaction.
I tried using the "Send Message" but yet couldn't make this work.

You can take a look at the documentation for camera path animator if needed.
http://support.jasperstocker.com/camera-path-animator/documentation/code/animator-component-code/

By the way what is name of the "debug" node in ORK? I would like to add it as next step to check myself.

Thanks!
Post edited by gamingislove on
  • Prefabs are for stuff that will be spawned by the event - if you want to call the function on something that already is in the scene, you need to use an actor or a waypoint.

    E.g. like the tutorial event uses the waypoints that are already in the scene :)

    There is no debug node, but you can use the Add Console Line step to print something on ORK's in-game console (which can be displayed using HUDs). The in-game console can optionally also output to the Unity console (if enabled in Game > Console Settings).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks Gil,

    I just quick forwarded one step of the tutorials and missed the actors and find object... :)

    So "Actors" can be regular in-scene GO's. In which we can make searches and create lists inside Events. When I read the in-editor Help for the "type" I finally understood.

    Here is what happens when I call the "Play" function.

    I have the "camerapathanimator" script on the same object as the event interaction. In event; I add an actor as object type and set "Event Object" to true. After that calling the function works.
    But, Although my camera path is somewhere else in the scene, camera tries to look-at the player.

    Block camera and Player Controls settings are set to true in the event settings node and "Turn Player to event" is false in the event interaction script.
    I cannot understand why does the camera tries to look-at the player. I'm sure I'm missing something.


    And as for the console; I'm using 2.1.6 (I know 2.17 came out)

    and when I go to Game>Console Settings editor goes blank and I get the following errors.

    I tried 2.1.7 on a new blank project and didn't get an errors. Thought I mention it just in case.


    InvalidOperationException: Operation is not valid due to the current state of the object
    System.Collections.Generic.Stack`1[System.Boolean].Pop ()
    ORKFramework.Editor.EditorAutomation.Automate (System.Reflection.FieldInfo fieldInfo, IBaseData instance, ORKFramework.Editor.BaseEditor baseEditor, Boolean ignoreHide, ORKFramework.AttributeHelper attributes)
    ORKFramework.Editor.EditorAutomation.Automate (IBaseData instance, ORKFramework.Editor.BaseEditor baseEditor)
    ORKFramework.Editor.ConsoleSettingsTab.ShowSettings ()
    ORKFramework.Editor.ConsoleSettingsTab.ShowTab ()
    ORKFramework.Editor.ORKEditorSection.ShowTab ()
    ORKFramework.Editor.ORKEditorWindow.OnGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)



    Thanks again GiL!
  • edited August 2014
    If the player/camera controls are blocked it's probably coming from either an event step that changes the camera, or from some other script (e.g. your camera path).
    Or, if you're using custom controls, they'll only be blocked when you let ORK know where to find them (more info in this how-to).

    The bug is solved in ORK 2.1.7 :)
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Hello again,

    Just to update what happened on this subject;

    I wasn't using any custom controls. Only steps I have are the event settings and call function

    Event interaction I'm using was set to Autostart , Blocking event, block camera/player controls.

    I think this way, I made sure it was the only ORK event running. But same thing is happening.

    While camera is animated on the path, it tries to look at the player and player is not blocked at all ( I can move the player)

    So I tried disabling my event interaction on scene load and added this script to new GO;

    void Awake()
    {
    GameObject.Find ("cam_anim_1").SendMessage ("Play");

    }


    it works fine this way. Camera plays and orients as intended.

    Also I tried a similar scene with the new version without a player and it worked too.

    Is there a way to check which ORK events are running? (on the console)
    Do you think there might be a bug around this issue?

  • If you only have the call to the function, the event will immediately end after that if you don't add a wait step.
    After the event ends, the player and camera controls are restored ... so either use a wait step to wait for a defined amount of time, or block the controls using the control block event steps rather than the event settings (you'll need to unblock them e.g. in your custom script by calling ORK.Control.RestoreControl(), or ORK.Control.SetBlockPlayer(-1) and ORK.Control.SetBlockCamera(-1)).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Wow! that was it. Thank you GiL.

    I've blocked camera and player by event nodes not on the event settings node.
    I can now add a wait node to wait until my camera path animation finishes.


Sign In or Register to comment.