not much of a programmer, that is why using Playmaker
That does make it more difficult to integrate 3rd party assets with one another.
I can certainly get you started on this one, but at a certain point your game may need something more specific than what I'm providing, and that's where you may need some custom scripting.
To start with, however, here are two simple scripts that will bridge Invector's player and camera controls with ORK's.
Place both scripts on your player prefab:
using Invector.CharacterController;
using UnityEngine;
namespace ORKIntegrationLibrary.Invector
{
[RequireComponent(typeof(vThirdPersonInput))]
public class ThirdPersonControllerBridge : MonoBehaviour
{
// Lock cursor when disabling controller input?
public bool lockCursor = true;
private vThirdPersonInput _thirdPersonInput = null;
void Awake()
{
_thirdPersonInput = GetComponent<vThirdPersonInput>();
}
void OnEnable()
{
_thirdPersonInput.lockInput = false;
if (lockCursor) { SetCursorLock(true); }
}
void OnDisable()
{
_thirdPersonInput.lockInput = true;
SetCursorLock(false);
}
public void SetCursorLock(bool cursorLock = true)
{
Cursor.visible = !cursorLock;
Cursor.lockState = cursorLock ? CursorLockMode.Locked : CursorLockMode.None;
}
}
}
using Invector.CharacterController;
using UnityEngine;
namespace ORKIntegrationLibrary.Invector
{
[RequireComponent(typeof(vThirdPersonInput))]
public class ThirdPersonCameraBridge : MonoBehaviour
{
protected vThirdPersonInput _thirdPersonInput = null;
void Awake()
{
_thirdPersonInput = GetComponent<vThirdPersonInput>();
}
void OnEnable()
{
_thirdPersonInput.lockCameraInput = false;
}
void OnDisable()
{
_thirdPersonInput.lockCameraInput = true;
}
}
}
In the ORK Editor, (under Base/Control -> Game Controls) set both Player Control Type and Camera Control Type to "none". Then in the Custom Controls section, add two entries:
Blocked By: Player
Placed On: Player
Behaviour Name: ThirdPersonControllerBridge
Blocked By: Camera
Placed On: Player
Behaviour Name: ThirdPersonCameraBridge
With this, you'll have your player and camera controls blocked whenever ORK would usually block its built-in player/camera controls. So this gives you exactly what Opsive's ORK integration does.
That's the easy part. If you want to get into integrating the combat system such that you have ORK handling all of the stats, damage calculations, etc, then it gets considerably more complex.
(But still workable, although it will require modifying Invector's code in a few places.)
This works Thank you. Have you ever used it with Ork though? The reason I'm asking is because there is a spawning issue. The character spawns from the main menu but does not appear in any scenes after that.
Ok Issue Solved Now.
If anyone else has this problem turn off Invector’s Third Person Controller component on your player’s prefab – click on Open Properties and Locomotion and disable Use Instance.