Forum rules - please read before posting.

Ootii Motion Controller - AC integration script - Question

Hi my friends,
I use AC with its own Third Person Camera, so Movement method is Direct, and the Input is Mouse and Keyboard. I see, Chris (AC's creator) made a bridge script to Ootii Motion Controller. I would like that, I would like to create more movement and some attack combo, I checked Ootii and I saw it can helps me without big scripting etc.

Can I switch in play mode between Ootii and AC own movement system method, if I want to?

If I buy Ootii, I just put the Ootii's script to my current player and this bridge script and can it works?
https://www.adventurecreator.org/tutorials/adding-custom-motion-controller

Thank you for your helpful answers in advance:)

Comments

  • I bought Ootii today. I try to implement it into my created AC game system. I've created the CustomControllerLink script and put PlayerBot with AC's Player and Paths components, made what you wrote on that link, what I've wrote up.
    I get these error messages continuously:

    1.
    "NullReferenceException: Object reference not set to an instance of an object
    AC.CharEditor.SharedGUIOne (AC.Char _target) (at Assets/AdventureCreator/Scripts/Character/Editor/CharEditor.cs:36)
    AC.PlayerEditor.OnInspectorGUI () (at Assets/AdventureCreator/Scripts/Character/Editor/PlayerEditor.cs:15)
    UnityEditor.UIElements.InspectorElement+c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)"

    2.
    "Instance of CustomControllerLink couldn't be created. The the script class needs to derive from ScriptableObject.
    UnityEngine.ScriptableObject:CreateInstance(String)
    AC.Char:ResetAnimationEngine() (at Assets/AdventureCreator/Scripts/Character/Char.cs:2695)
    AC.Char:GetAnimEngine() (at Assets/AdventureCreator/Scripts/Character/Char.cs:3818)
    AC.CharEditor:SharedGUIOne(Char) (at Assets/AdventureCreator/Scripts/Character/Editor/CharEditor.cs:24)
    AC.PlayerEditor:OnInspectorGUI() (at Assets/AdventureCreator/Scripts/Character/Editor/PlayerEditor.cs:15)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)"

  • Besides these error messages, I put hotspot detector into Player, but when I'm close to the NPC, I can't see the hotspot name, so the detector doesn't detect the hotspots.

  • Besides, when I want to born my Player to the PlayerStart marker, it just falls down and goes left or right, so it doesn't stop.

    I hope somebody can help in it, because I bought this asset, but I can't see that what I should.:(((

  • What is your AC version? The errors suggest you're not using the latest release.

    The CustomControllerLink is not an animation engine - don't assign it in AC's Player component, just add it to the same GameObject. You can share screens of your Player's full Inspector if you want.

    If you're having trouble with the Hotspot detector, try to get it working without involving Ooiti as that only adds complexity to it. A tutorial on Hotspot detectors can be found here.

  • v1.70.4

    Now, I deleted the CustomControllerLink from AC's Player component and no error messages. Hotspot detector detects hotspot, so it's okay, too. But..

    One thing is big problem: When I start the game my player fly around in the scene, so teleport to the Playerstart marker. If I pause the scene and after I try to put close to over terrain, it can detects terrain collider and my player stop flying around the scene fast.

    What is the problem? I use Adventure creator for the game, I put only the Playerbot script into my Player, so no other MotionController stuff in the scene. Do you have any idea, what can cause this problem?

    Thank in advance Chris!

  • I didn't say to delete the CustomControllerLink - but make sure it isn't set as the "Animation engine", which is what your error message was suggesting.

    Re-add the component, but don't reference it in the Player component. Then share screenshots of your full Player Inspector, and Settings Manager, so we can see exactly what you've got.

  • I've made it, I haven't deleted the CCL components, just delete it in reference field in Player component. I will make screenshot soon, and I will upload.

    Thank you very much for your time! If you have Paypal or some kind of support place, I would support your time of course!

  • Be sure to assign the CCL Inspector's "Unity Input Source" field.

    Other than that, any motion issue you're getting may be down to ooti - since the CCL script does little more than change the Input Source and Target Position.

  • Yes I assigned it, just there is no on the picture, because I was in prefab, when I made the pictures.

    When I use ooti with this settings, Adventure Creator can teleport my player or not?

  • edited May 2020

    It does on my end.

    When I start the game my player fly around in the scene, so teleport to the Playerstart marker.

    So you yourself are teleporting with an Object: Teleport Action? Please be clear about what the situation is, and what exactly it is you're doing.

  • Sorry for my missing words, yes it's a strange sentence:D

    So, When I start the game, my player flies around in the scene, so AC doesn't teleport to the Playerstart's marker my player, just flies around in the scene and it just keeps moving away from Playerstart marker.

    I don't use Object: Teleport action, it's AC's starting mechanism, it moves the Player to the Playerstart after I start the game.

  • edited May 2020

    Right, but if you do use an Object: Teleport Action to manually teleport him somewhere - does it work?

    Perhaps the flying is caused by the teleporting attempt. If you instead remove the PlayerStart, what is the behaviour?

    You mentioned terrain earlier. Try a more simple scene - just a single Plane for a floor. Is there still an issue?

    It is possible to hook into the OnOccupyPlayerStart event to manually update your custom controller, but as I said it's not necessary on my end. Such code, inserted into the CCL script, would look something like:

    void OnEnable () { EventManager.OnOccupyPlayerStart += OnOccupyPlayerStart; }
    void OnDisable () { EventManager.OnOccupyPlayerStart -= OnOccupyPlayerStart; }
    
    void OnOccupyPlayerStart (Player player, PlayerStart playerStart)
    {
        // Player has been teleported to PlayerStart.Position
    }
    

    I'd recommend contacting ooti, with the above, to see if you need to call any MC function to let it know that the teleporting has taken place.

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.