Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

GARGOYLE (rigged, skinned and animated)

Discussion in 'Assets and Asset Store' started by PROTOFACTOR_Inc, Jul 8, 2014.

  1. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,029
    Hi there, a new creature is available!

    Here is a Gothic monster that will definitely add to the ambiance of your heroic fantasy castles. Gargoyle will be able to surprise its enemies and deal great damages with its sharp claws. Model is 11.3 Ktris and comes with 2 different skins (statue and alive), 2048*2048 diffuse, specular, normal textures are included (body and wings) and a 512*512 self illumination one for the glowing eyes of the awaken variation. A prop version of the statue variation is also included with 3 LOD stages ( 5-2 Ktris, 6.8 Ktris and 11.3 Ktris). The package include 27 quality animations.

    DIRECT LINK TO ASSET STORE

    CHECK IT OUT IN ITS WEB PLAYER


     
  2. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    looks really nice rozor! , but every time I use your webplayer previews Im highly annoyed by the controls, it should be click-hold and drag to rotate, mouse wheel to zoom in out. Then I can position the view as I want it and cycle through the animations, then change position and cycle through the animations again. This current rotation locked to free mouse movement will drive me insane.

    In fact I will write the script for you just so that it wont happen again next time im trying to appreciate your awesome models ;) Will post the code here soon.
     
  3. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    Its not a super fancy script but it will orbit only when you click and drag with LMB. XAxis is clipped to 90deg. There is an additional field named modelOffset which you can use for characters that have their registration points at the feet, just set the y value to the models height or half height, which ever you prefer. Scrollwheel to zoom. Attach this to your Camera and then set the model field to your model in the inspector. You can choose the starting radius in the inspector as well.

    Of coarse you dont have to use this at all .. its your preview but consider having a button to at least toggle this behaviour for people like me who hate the rotation been locked to free mouse movement. Im sure if you looked on the wiki their might even be a better script then this, i just wrote it up quickly.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class CameraOrbitCustom : MonoBehaviour {
    6.  
    7.  
    8.     public float radius = 15f;
    9.     public float zoomSpeed = 2f;
    10.     public Transform model;
    11.     //if you want an additional offset added to the model view point
    12.     public Vector3 modelOffset = Vector3.zero;
    13.  
    14.     private float angleXAxis = 0;
    15.     private float angleYAxis = 0;
    16.     private float screenXDelta = 0;
    17.     private float screenYDelta = 0;
    18.     private Transform transformCache;
    19.     private bool firstRun = true;
    20.  
    21.     void Start () {
    22.         transformCache = transform;
    23.     }
    24.  
    25.  
    26.     void Update () {
    27.  
    28.         bool invalidate = false;
    29.  
    30.         if (firstRun) {
    31.             firstRun = false;
    32.             invalidate = true;  
    33.         }
    34.  
    35.         float mouseWheelDelta = Input.GetAxis("Mouse ScrollWheel");
    36.         if (mouseWheelDelta != 0) {
    37.             invalidate = true;  
    38.         }
    39.  
    40.         if (Input.GetMouseButton (0)) {
    41.             invalidate = true;  
    42.         }
    43.  
    44.         if (invalidate) {
    45.             Vector3 lookAt = model.transform.position + modelOffset;
    46.             Vector3 camPosition  = lookAt;
    47.             radius -= mouseWheelDelta*zoomSpeed;
    48.             screenXDelta = Input.GetAxis("Mouse X") * 270 * 0.04f;
    49.             screenYDelta = Input.GetAxis("Mouse Y") * 60 * 0.04f;
    50.  
    51.             float x;
    52.             float y;
    53.             float z;
    54.  
    55.             angleXAxis += screenYDelta;
    56.             if(angleXAxis > 0){
    57.                 angleXAxis = 0;
    58.             }
    59.             if(angleXAxis < -89f){
    60.                 angleXAxis = -89f;
    61.             }
    62.             float rad = angleXAxis * Mathf.Deg2Rad;
    63.             y = radius * Mathf.Sin (rad);
    64.  
    65.  
    66.             angleYAxis += screenXDelta;
    67.             rad = angleYAxis * Mathf.Deg2Rad;
    68.             x = (radius+y) * Mathf.Sin (rad);
    69.             z = (radius+y) * Mathf.Cos (rad);  
    70.          
    71.             camPosition.x -= x;
    72.             camPosition.y -= y;
    73.             camPosition.z -= z;
    74.  
    75.             transformCache.position = camPosition;
    76.             transformCache.LookAt(lookAt);
    77.         }          
    78.  
    79.     }
    80.  
    81. }
    82.  
     
  4. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,029
    hello there, sorry about this late reply. Thanks for the kind words and the help you're offering. Not sure if you have noticed, but in all the web players, there is third person controllable character with an orbit camera and another character that can preview all the animations. Means you can move around and check the controllable one from every angle easily and move around the other one to check the animations. It's just to give the potential customer a feel of how the model would behave in the environment. I can understand some doesn't like it
     
  5. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    I actually did not know about the 3rd person character 1 up for that ;) but no matter where i move him it will not matter because every time I move the mouse to the animation menu the scene spins around.

    I know you say its just a teazer for potential clients but you could set up a toggle between the static model and the 3rd person model. Once the code is done you dont have to do it again... but anyway no worries.
     
  6. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,029
    I totally understand, I wish I could do that, but here I'm far from being a coder. It would just be a dumb simple toggle thing though .. but well ... will try to figure something out....
     
  7. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    I can sort it out for you if you like, I know I have a slightly better 3rd person script laying about from a few years ago as well which does not do those hard rotation angle jumps when changing direction without using two arrow keys like yours currently does.

    Perhaps just send me your script which is looping the animation object and building your GUI so I can integrate with what you have and add a toggle or button in at the right size etc the changes would be minimal really
     
  8. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,029
    you would be awesome to do that for free!! going to PM you then. thanks a bunch in advance! :)
     
  9. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Can really just agree with shaderbytes. It would be great to have an option to not rotate if moving the mouse. Every time I want to look at another animation you have to click and move back to look at it. It's really annoying, but it's great that you offer a webplayer view of course. Actually I can only say this way of doing webplayer view is a good one to give an example.
    https://www.assetstore.unity3d.com/en/#!/content/15420
     
  10. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Oh and of course the Model is great. It's very nice of you to offer indie developers and hobbyists such fair deals. Thank you.
     
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    I'm not going to make any recommendations, but I'd like to see the controls for the previews upgraded as well. I figured out how to work around it, but the controls have always seemed counter-intuitive to me.