Search Unity

[RELEASED] StrayTech Camera System

Discussion in 'Assets and Asset Store' started by DanielStrayer, Mar 30, 2016.

  1. DanielStrayer

    DanielStrayer

    Joined:
    Jan 10, 2016
    Posts:
    1
    StrayTech Camera System

    A professional quality camera solution designed to allow developers to quickly implement and refine a wide array of camera setups and transitions.

    The package contains eight different camera types listed below. Set up camera state definitions with ease, place trigger volumes for the camera states where you want them, and the rest is handled by the system. There are three different ways to transition between states; interpolation, cross-fade, and instant. Camera state modifiers allow you to quickly and easily set up behaviors to modify the current camera state's base behavior.

    Playmaker extensions are included and full source allows for easy extension of the system.

    Requires Unity 5.3.3 or later. (Will change in the future to support back to 4.3)

    Version 1.0.0

    -------------FEATURES-------------
    Camera States:

    - Isometric Camera
    - Spline Camera
    - First Person Camera
    - Third Person Camera
    - Animated Camera
    - Pivot Camera
    - Parented Camera
    Camera State Modifiers:
    - Camera Shake Modifier
    - Focus On Target Modifier
    - Zoom In On Target Modifier
    - Field Of View Modifier

    Other Features:
    - Camera Collision
    - Transition seamlessly between different Unity Cameras
    - Playmaker Extensions
    - User Defined Flags System
    - Full Source Code
    - Documentation And Demo Scene
    - Fully Unity 5 Compatible


     
    Last edited: Apr 2, 2016
  2. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    121
    may you publish a web demo?

    does it work with multiple camera?

    does it have an RTS camera ?

    does it support touches? (swipe/twist/pinch)
     
  3. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    I may. I will see about doing that in the future.

    The system works with multiple Unity cameras as well as multiple camera states.

    It has an isometric camera, I suppose the only thing missing would be making an isometric camera zoom-able, then it would be an RTS camera. Right? If that is the case, I could add an RTS camera for the next update.

    The system currently only supports Unity's default "Horizontal" and "Vertical" inputs. I could look into adding touch capabilities for a future update.

    Thanks for the feedback and questions.
     
    Last edited: Apr 26, 2016
  4. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Could you add integration with Motion Controller? If I understand correctly it requires doing all calculations not in Update/LateUpdate but in some MC thing.
     
  5. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    I have not used Motion Controller, and do not own it, but there should be no reason that the two couldn't work together with very little effort.

    I can not add support for all the different Unity assets out there, but if I hear enough about one asset from the users of my system, then I will likely purchase it and add support for it.
     
  6. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    I got it to work with the Motion Controller.
    Yes, it does function a little differently.
    At first I was trying to "piggyback" on the existing Camera Rig, but I ended up just replacing the whole camera system in there with this one because it was giving me some "popping" or "jittering" movements.

    By playing around with the Use Fixed Update options on the targets, I was able to stop the popping.

    For my setup I was using the "Adventure Camera" setting, so the controller needs to know about the camera. In the "Advanced Settings" for the Motion controller, I just replaced the existing camera rig with the Straytech camera and it worked fine.

    In order to get the camera rotations with the joystick, you'll have to look in the Input Settings. I believe there's something way down the list there called "WXRightStickX", and "MXRightStickX". I think that's what the MC is looking for when it rotates the camera.
     
    montyfi likes this.
  7. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    I see there's a "User Defined Trigger Gate" in there that lets you switch camera targets in code.

    Would you have an example of how to call that up in code?


    Also, I have my character walking around a spherical planet object.
    The Third Person Camera setting works great if you have flat levels, but is there a way I can define an up vector for it, so that it's always oriented with the player as he moves around this "planet"?
     
    Last edited: May 1, 2016
  8. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    To switch camera states manually, take a look at the following script:
    Assets\StrayTech\Camera System\Scripts\Misc\InputBasedCameraStateTransition.cs

    User Defined Flags can be used however you want, but currently are implemented as a way to 'gate' the transition to a new state.

    For instance, if you have a cover system in your game, and the cover system incorporates bringing the camera in close when the character is covering. The cover system could set a "Player_Cover" user defined flag, and a camera trigger volume could be gated by that flag. The behavior would be that while that flag is true, and the volume is in the intersected state, the camera system will register the volume's state, otherwise it will unregister the state.
     
  9. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Hello, I recently purchased your asset but i have a problem when building (for Mac):

    Assets/StrayTech/Camera System/Scripts/Triggers/CameraSystemTriggerBase.cs(65,21): error CS0246: The type or namespace name `List`1' could not be found. Are you missing a using directive or an assembly reference?

    Any idea ?
     
  10. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    @PeteLaChatte, I just found the problem, it is a bug. I will fix this bug in the next update, but to resolve the issue, open the CameraSystemTriggerBase.cs script file, and make the following change:

    Before:
    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using UnityEditor;
    3. using System.Collections.Generic;
    4. #endif
    After:
    Code (CSharp):
    1. using System.Collections.Generic;
    2. #if UNITY_EDITOR
    3. using UnityEditor;
    4. #endif
     
  11. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    I just uploaded an update to fix this problem, as it will effect all platform builds. Expect it to go live within the next 10 days or so.
     
  12. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Could you give us an idea of what is going to be added in this update?
     
  13. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    I hope to add the following:

    - RTS Camera
    - More Playmaker actions to interface with system at code level
    - Add Boolean option that allows system to follow camera target orientation (use case: curved world)
     
    rubble1 likes this.
  14. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    The bug fix update is now live. The next update will contain the new features.
     
  15. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Awesome!
     
  16. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Hi, how can i make so that the StrayTech folder can 'not' be in the root folder ? Like a /Assets/3rd_part/StrayTech/ ?
    Thanks
     
  17. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    I think the only lines that require that the plugin be in the root, are the icon related lines. If you comment those out, or update the paths, you should be able to move the system around.

    The [RenderHierarchyIcon("")] line would need to be commented out or updated in the following files:
    CameraStateDefinition.cs
    CameraSystem.cs
    CameraSystemTriggerBase.cs

    I will try and make the paths relative for the next update, but those three exceptions shouldn't hurt anything in builds.
     
  18. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    @DanielStrayer hey, so i want to setup a camera location for when characters are having a conversation, but then when you exit out of the conversation, you go back to the exact camera state you were in before. Is that what "SetCameraStateTempOverride()" would be for? How would I store the old state/position so i could go back to it?

    Also, feature request - instead of hardcoding a vector3 for a position, it'd be nice to attach a gameobject, so that i can move the gameobject and set it up exactly where i want (talking about states like Isometric and Pivot)

    PS - love the implementation, great stuff, can i send you some custom camera stuff i wrote for it so you can add it to the library?

    Edit - after a little testing, looks like RegisterCameraState/UnRegisterCameraState is what i was looking for.
     
    Last edited: Jun 26, 2016
  19. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    @Drowning Monkeys I am open to recommendations. I have been working on the next update slowly but steadily.
     
  20. Ubik3d

    Ubik3d

    Joined:
    Sep 13, 2015
    Posts:
    6
    Is it easy to send FSM events to playmaker at specific camera positions with this plugin?
     
  21. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    121
    Hi Daniel,
    great for RTS camera.
    have you added touch capabilities ?
     
  22. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    @Ubik3d - Not sure what you mean, but if you can clarify what you are trying to do, i'm sure I can help.

    @Magic73 - I have not added any touch capabilities. What would you use touch capabilities for?
     
  23. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    121
    Even if you doesn't support touch capabilities, is it possible to add it externally? (by extending your class, and overriding the control method... as example)

    I have the Easy Touch asset (https://www.assetstore.unity3d.com/en/#!/content/3322), and I would like to use it as input control.
     
  24. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    @Magic73 - It is possible to extend the camera control by creating a new or modifying an existing CameraState class. You can provide whatever input method you want for the cameras.
     
  25. launemax

    launemax

    Joined:
    Feb 14, 2013
    Posts:
    7
    Hey @Daniel-Strayer,

    i have a question: When I transition back from FirstPerson to ThirdPerson the camera is always facing the character from the front. So if you do this while running, you instantly stop and run the wrong direction. Is there a way to set the Camera behind the player, if I switch to ThirdPerson again?

    Thanks for this great asset und kind regards,
    Launemax
     
  26. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    Yes, You can modify the default behavior in the ThirdPersonCamera.cs script.
     
    Last edited: Jan 11, 2017
  27. launemax

    launemax

    Joined:
    Feb 14, 2013
    Posts:
    7
    Hy :)

    Thanks for your answer.
    Unfortunatly it doesn't work. If I enable ThirdPersonCamera (or set it as default state) the camera is looking anywhere and ignores my mouse (no orbiting). If I press any keys the camera moves, but always looking at the same angle.
    I think it just breaks the lookTowardsTarget, because the position gets updated and seems to be correct.

    http://www.launemax.at/straytech_bug.gif
     
  28. launemax

    launemax

    Joined:
    Feb 14, 2013
    Posts:
    7
    Have you already figured out, what the issue is? Thanks for your help in advance @Daniel-Strayer
     
  29. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    Sorry for the delay, I was traveling. I have messaged you personally through your Unity Profile @25motion. Once we figure out what is wrong, I will update the default behavior of the Third Person Camera if need be.
     
  30. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    Hi @Daniel-Strayer,

    I just picked up the asset. Nice work on the package! What's the best way of adding new cameras to the framework? Let's say instead of the FirstPersonCamera using mouse inputs I want to have another FirstPersonGyroControlledCamera for mobile.

    I know I can hack a new class, update CameraSystem.CameraStateEnum with a FirstPersonGyroControlled value, etc, but ideally I'd like to do this without having to modify the package's classes. At some point I'd also like to try getting this to work with Camera Perspective Editor asset which also modifies camera settings beyond what StrayTech's offers.

    Thanks!
     
  31. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    Currently, that is the only way to extend the system. For reference, the parts that would need to be added / updated are as follows:

    1. Add StrayTech\Camera System\Scripts\Camera States\NewCamera.cs
    2. Add StrayTech\Camera System\Scripts\Camera State Definition\Camera State Settings\Concrete\NewCameraStateSettings.cs
    3. Add StrayTech Camera System\Assets\StrayTech\Camera System\Scripts\Camera State Definition\Editor\NewCameraStateSettingsPropertyDrawer.cs
    4. Add NewCamera to CameraStateEnum enum in CameraSystem.cs
    5. Update StrayTech\Camera System\Scripts\Camera State Definition\CameraStateDefinition.cs with your new camera classes.
    6. Update StrayTech\Camera System\Scripts\Camera State Definition\Editor\CameraStateDefinitionEditor.cs with your new camera classes.

    Let me know if you need any help.
     
    Last edited: Feb 11, 2017
  32. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    Ok, that looks pretty straightforward. I'll let you know if I hit a snag.
     
  33. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    @Daniel-Strayer Hmm doesn't look like my last post went through. I got my cameras working. I also needed to edit the StrayTech\Camera System\Scripts\Camera State Definition\Editor\CameraStateDefinitionEditor.cs file.

    Note to future self :) I just wanted to drop my custom gyro controlled camera into the system and have it work. I duplicated an existing camera's files with access to my own code and passed through to ICameraStates's UpdateCamera method via this.Position and this.Rotation.
     
  34. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    @Daniel-Strayer How come when I add a Camera State Definition Component the default values are zeroed out? When I change the Camera State field to Third Person and try to use it the Target Offset and Motion Smoothing aren't set to the defaults making it seem like it's broken if you don't know Motion Smoothing has to be greater than 0 to have any effect.

    Also in a future update could you make DoCameraUpdate public? Having the option of a FixedUpdate vs Update is nice, but having a LateUpdate would be useful too. To solve a movement jittering issue I had to either put my movement calculations in FixedUpdate which seems wrong or call DoCameraUpdate in LateUpdate

    And then if you want to manipulate the camera's time using Chronos that's another thing to consider.
     
    Last edited: Jan 27, 2017
  35. xexuxjy

    xexuxjy

    Joined:
    Feb 10, 2014
    Posts:
    16
    Hi Daniel,

    Do you have any recommendations about setting up state definitions outside the editor? (e.g. by creating my own state definitions in my c# scripts) . All of the values in the state scripts appear to be private and while I can add my own accessors and extensions I just wondered if you or anyone else had 'd done much in the way of handling camera states and interactions purely in code?

    Thanks,

    Mark
     
    rubble1 likes this.
  36. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    @doq Thank you for the feedback. I will take your recommendations into consideration for a future update.

    @xexuxjy I will be opening the asset up more for script accessibility in a future update.

    Thanks for the feedback everyone!
     
  37. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    117
    Hi
    could you post a screen shot of the settings available for the 3rd person camera? im thinking of buying but want to know whats possible first.

    can it (the third person cam)be used like the smoothfollow cam so it always stays behind the player? but with height, rotation damping etc etc.

    would be cool to have a web demo or a demo package to try out first :)

    many thanks
     
  38. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    The Third Person Camera state has the following settings:

    MouseOrbit - Use the mouse to control the camera's orbit.
    TargetOffset - The position offset from the target.
    MouseOrbitDistance - The minimum and maximum distance the camera can be from the target.
    MousePitchRange - The range of vertical rotation.
    MouseSensitivity - Sensitivity of mouse movement on each axis.
    MouseInvertY - Invert mouse Y axis?
    MotionSmoothing - The amount of smoothing to apply.
    UseCameraCollision - Whether to use camera collision or not.
     
  39. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    Is there a way to make branching splines? I need to have a VR camera rig follow a spline and have branching paths so the rig follows the character at a certain distance on the spline where the game has branching parts of the level.
     
  40. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    You would have to implement branching logic yourself. The simple implementation included does not support it.
     
  41. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    Can two splines overlap and then triggers set up to fade between them?
     
  42. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    That sounds like it could work.
     
  43. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    @Daniel-Strayer, I'm wanting to use this in VR, and instead of moving a camera I need to move the camera rig itself (parent game object). What's the best way to accomplish this?
     
  44. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    You would need to modify the system. It was not developed with VR / AR in mind.
     
  45. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    Ok, I modified it to reference a GameObject instead except for where it makes changes to FOV I grab child camera components and got it to work. Having the option in the future may be a good addition.

    Thanks for the prompt response.
     
  46. hoseinakbo

    hoseinakbo

    Joined:
    Apr 8, 2015
    Posts:
    9
    I'm trying to find how I can use camera collision so that the camera doesn't go into meshes but I can't find how the camera collision component works.

    Can anyone help with this?
     
  47. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    @hoseinakbo Check out the sample scenes. There is a Camera Collision component. Also make sure camera collision is enabled on the CameraStateDefinition.
     
  48. hoseinakbo

    hoseinakbo

    Joined:
    Apr 8, 2015
    Posts:
    9
    @Daniel-Strayer Thanks!
    So I've found out that the camera collision is just for when the camera is transitioning, is there any way to use this feature for when the camera is in a normal state following the character?
     
    Last edited: Apr 24, 2018
  49. Daniel-Strayer

    Daniel-Strayer

    Joined:
    Apr 16, 2013
    Posts:
    68
    @hoseinakbo That shouldn't be the case. The camera collision should be active for any CameraStateDefinitions that have it enabled. Make sure you have CameraCollision enabled on all the state definitions you want it on.
     
  50. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    859
    Is this still supported/working in Unity 2019?
     
unityunity