i followed exactly the tutorial on how to setup custom controls but it doesnt work the custom camera script had a target settings.. i know that the problem is ork is the one responsible for spawning the combatant in field and i must modify the script & put this
GameObject player = ORK.Game.GetPlayer();
code. my question is where shoul i attach this code?
Note that the first pic is setting for the main camera in town
You'll most likely need to add this in the ARPGFollowCameraController script. According to the inspector image, there is a field named target to define the camera's target - all you have to do is set this field e.g. in the Update or LateUpdate function (wherever the camera code is executed).
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!
all you have to do is set this field e.g. in the Update or LateUpdate function (wherever the camera code is executed).
ok i will open the ARPGFollowCameraController script then i will find this update or lateupdate function then i will add the name of my combatant.. let me try this
so here is the code where the lateupdtae function lies
void LateUpdate () {
if(target == null) { return; }
// Zoom Camera and keep the distance between [minDistance, maxDistance]. float mw = Input.GetAxis("Mouse ScrollWheel"); if(mw>0){ startingDistance-=Time.deltaTime*zoomSpeed; if(startingDistancemaxDistance) startingDistance=maxDistance;
And you'll need to add the ORKFramework namespace at the top of the script:
using ORKFramework;
Moved to scripting section.
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!
Seems like you need a float parameter named 'speed' in your animator controller?
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!
Yes - if you need the player's game object in one of your scripts, that's the way to go :)
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!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Insert the following:
GameObject player = ORK.Game.GetPlayer();
if(player != null)
{
target = player.transform;
}
And you'll need to add the ORKFramework namespace at the top of the script:
using ORKFramework;
Moved to scripting section.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
at the start:
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
do i need to insert the previous code as before?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!