Search Unity

How do I create this portal? (See Image)

Discussion in 'General Graphics' started by DarkEcho, Mar 12, 2019.

  1. DarkEcho

    DarkEcho

    Joined:
    Jul 7, 2014
    Posts:
    233
    How do I create this portal? (See Image)

    Im wanting to create this portal, the "wub wub" effect and colour change (not the appearance animation)

    Where would I start?
    Im using Blender
    From what I can tell, i think id have to make a single mesh and 'pulse' its scale via a script/animation.
    As for colour..not sure how to achieve that...
    How would I achieve this and is my idea for the animation a good idea?

    Thanks!

    [EDIT] Unity doesnt seem to like me posting gifs. See below link.
    https://i.imgur.com/GPk8HEm.gif
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    That sort of just looks like a single image being rotated as its scale changes, with the color of the sprite being changed over time as well. Your Animation approach is probably fine, or you could change the values in code via Update or a Coroutine. Maybe there's more to it than that, but you could probably start with a pretty close approximation by:
    • Creating the sprite, looking pretty much as it looks here, at its max size. The sprite should have pretty much the color you want.
    • Create a world-space canvas, put an Image on it, and assign the sprite you made to the image.
    • Add an Animator to the game object, create an Animation Controller and an Animation.
    • In your Animation, adjust the scale and local rotation (or local euler angles) to make it grow and spin. Also adjust the image's Color to add more purple, or whatever you want, to the sprite over time. This will just add more tint to the sprite.
     
  3. DarkEcho

    DarkEcho

    Joined:
    Jul 7, 2014
    Posts:
    233
    Ok im going to give this ago.
    Ive created a sprite (Im just using the unity square sprite) added the Animator and assigned a controller.
    In the controller ive done this...and now I dont know how to go about scaling...
    When you say make an animation, do you mean go into the external modeling program and make one there, or did you have something else in mind?
    img.png
    Ive only made one animation so im inexperienced.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    By "animation", I meant to create an Animation Clip. Notice in your screenshot that the "Motion" field at the top of the inspector has no value. It's expecting an Animation Clip to be assigned. The Animation Clip is the thing that holds all of the keyframe information, and is actually responsible for changing all of the properties of the object.

    I recommend you go through some of Unity's tutorials on Animations (https://unity3d.com/learn/tutorials/s/animation), but here's the basic idea:

    To make one, right click somewhere in your project view, go to Create, and choose Animation. I usually keep the clips in the same folder as the Animation Controller, unless it's a generic enough clip to be used by many controllers. From there, I'd assign that new clip into the Motion field of the animator state.

    Now, open the Animation tab (Window -> Animation -> Animation), and make sure you've clicked on the object in your Hierarchy view that has the Animator Controller on it. You should see something like this:

    upload_2019-3-13_18-54-43.png

    The circled part is a dropdown letting you pick the clip you want to modify. From there, those little diamonds represent keyframes that allow you to change a properties values over time. Click "Add Property" to add more fields.

    Also note, you can preview the animation in Edit mode, which is very convenient.