• edited November 2020
    6b) that definitely checks out. Here:
    - Using Turn Based Battles and Grid Battles
    - Control Block settings:
    Block player control : battle
    Allow in Turn : none
    Block in Battle Menu : disabled
    Transfer player control : enabled (this seems highly relevant!!!)
    Block Camera Control : none
    Block in Battle Menu : disabled
    - Battle Camera Setup
    Battle Camera Type : Allow Events
    Start Toggle State : Enabled
    Everything else disabled as far as I can tell
    - Battle events
    gridStartEvent : this is as in the tutorial as far as I know. It destroys the player group (Destroy Object : actor, player group), then spawns combatants (enemies, then allies), then does player grid placement.
    gridVictoryBattleEnd : change music, show dialogue, collect battle gains, change music, destroy combatants (all), hide battle grid. I've added a camera control target (reset) and it worked in the first test but none of the tests afterword.
    TurnStartEvent : show image (a plaque which reads "are you ready?"), wait for input, remove image. This used to have Search Objects (value "user", set, search by tag "ally"), camera control target (found objects, "user", child object 'camerapoint'), check faction (value "user", faction player), all before the show image stuff, but that wasn't working right and I've disabled it. I believe the function is now handled via transfer player control in control block settings.
    TurnEndEvent : camera control target (reset), change camera position (fade to position, position grid battle view, waypoint,). I'm not actually sure what that change camera position node is for. I think originally it was there to change the camera to an overlook position over the battlefield between turns but wasn't working and eventually I changed camera control target to (reset) instead... it's been a long time and I don't really remember. =\
    - Group Member Keys : I don't know? they have plus and minus key's set up with an axis based input. All settings for Group Member Keys are disabled.
    Post edited by Whatexists on
  • Yeah, definitely disable Transfer Player Control :)
    This handles only player control, not camera control.

    If you're not really using the battle camera, set the battle camera type to None.
    If the camera control isn't blocked, a Change Camera Position node will not really work, as camera control and camera position both try to change the same camera, overriding each other.
    Now, since you use turn start/end events for changing camera control - that's actually all built-in functionality of the battle camera via the camera control target settings. E.g. a setup with Allow Events and enabling Camera Control Target, Selecting Player Member and maybe Battle Arena should have the same effect. The additional Look At settings can be used to do additional things, e.g. during target selection.
    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!
  • Alright I disabled Transfer Player Control, and changed my battle camera set up to Allow Events, and enabling Camera Control Target, Selecting Player Member, and Battle Arena. Then in the Look At settings I enabled Look At Selecting User, with look at type Camera Control Target, look at child CameraPoint (which is an empty game object with just a transform that I use for the use child object setting of the mouse camera control type), and Reset Current Target enabled. This works basically how I want things to work! Thank you!

    I'm hoping I can use the rest of the Look At settings with look at type Simple Look to make the camera point at whoever an enemy is attacking, even while it's attached to the enemy. But before I do that I have a minor issue to work out:

    The Camera seems to attach to combatants at a closer distance than it is set to be out of combat and not reset to the further distance when it leaves combat again. Normally it's set to a distance of 1.5 (from CameraPoint, which is situated about 1.5 units above the base transform of the combatants parent game object, or right in the middle of the Combatant's chest between their shoulder blades). It seems like it sets to a distance of 1 instead of 1.5 when it switches to the battle camera, and then stays at that distance when the battle is over. Also, when figuring out how close it was getting I tested a few different distances by changing the normal out of combat distance and if I lower distance under Game Controls -> Camera Controls to 1 from 1.5 then the Battle Camera actually sets to an even closer distance that looks to be in the ballpark of 0.5.

    I tried setting a minimum distance for the Battle Camera under Look At Selecting User but the result was that it didn't attach to a combatant at all and remained on the arena if the distance origin was User, or that it wouldn't attach to enemies during their turns if the distance origin was Camera Control Target.

    Any idea why the Battle Camera might be hovering at a closer distance than the Camera is set to under Base/Control?
  • The min/max distance when using camera control target is used to check if the traget should be changed, e.g. you might not want the control to jump around when switching between close game objects.
    Are you using a child object in the battle camera's look at settings? That shouldn't be needed, as the camera would still use it's child object setup.

    Which camera control are you using? E.g. the Top Down Border camera has separate field and battle height 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!
  • That makes a lot of sense.

    I was using a child object in the battle camera's look at settings. I removed that. Although the camera is still hugging closer in combat.

    I'm using Mouse camera control type. I'm not seeing separate field and battle height settings for Mouse Camera Control type but I could be missing it.
  • Hm, no, the mouse camera has no separate settings for that. Strange ... are you using the collision camera 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!
  • Yes. Camera collision is enabled.
    Check type (cross)
    Layer Mask (default) - Combatant parent objects are not on this layer.
    Move towards : 1
    View Size : 0.5
    Player Child Name (blank)
  • Hm, is there any other object/collider present during battle that could cause the collision camera to get nearer? E.g. the battle's trigger.
    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!
  • The battles trigger collider encompasses the whole battle so yeah. I set the Camera collision to the backdrop layer so it shouldn't collide with the battle trigger and it's still zooming in closer by about 1/3 of it's defined distance.
  • Well, I guess I'll need a small Unity test project with your setup to figure that one out :)
    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!
  • I've stripped mine back as much as I can. I don't really know how to strip back artifacts or metadata which are most of it's size. But I'll send you a google drive link to the compressed version.
  • AFAIK you can delete the Library folder, as that'll be recreated when opening the project again.
    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!
  • I was wondering if there was any way I could trim that back and be confident the project would still work. Really glad to know I can simply delete it!

    more questions. I'm trying to use the look-at settings to get the camera to look at the enemies target during the enemies turn (or just look at the most recent person they've damaged). But when I enable Look At Latest Damage or Look At Selection I'm not noticing any changes during gameplay (the camera doesn't automatically do anything). Could something be blocking them from working? Currently the camera is under player control during enemy turns (it would be kinda nice to change that).
  • The main drawback is that next time opening the project will take some time since Unity will reimport/recreate the database.


    If the camera control isn't blocked, camera changes are usually overruled by the player control (i.e. camera change happens, but player control simply updates it again each frame). This would only work if you either block the camera control, or use the camera control target options (which only work with enabled camera control).
    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!
  • So for the first of those two options, blocking camera control, would I use a block camera control node to block the camera control during the start of enemy turn event, and then another one to unblock it at the end of the enemy turn?
Sign In or Register to comment.