Okay I have two problems here.
Please see this video.


1:
I'd like to put a texture animation in Makinom behind motion, but how should it be done?
If it's now, it's being treated with a GUI button. This isn't in the best state.

2:
I'd like to reproduce setting of Mecanim in Makinom, but how should it be done?

Source:
=============================================
using UnityEngine;
using System.Collections;

public class player : MonoBehaviour {

public Animator anim;
// Use this for initialization
void Start ()
{
anim = GetComponent();

}

// Update is called once per frame
void Update ()
{
if(Input.GetKeyDown("1"))
{
anim.Play ("Run",-1,0f);
}
if(Input.GetKeyDown("2"))
{
anim.Play ("Shoot",-1,0f);
}
if(Input.GetKeyDown("3"))
{
anim.Play ("Walk",-1,0f);
}

}
}
=============================================

Can anybody help me?
  • 1) What's happening when the GUI button is clicked, can you post the code? If you already have a function for that, you can use Makinom's function nodes (e.g. Call Function) to use that function in your code from a Makinom schematic.

    2) Use a Tick Machine with the Update start type enabled. In the schematic of the machine use an Input Key node to check for your different input keys (which need to be set up in Makinom's editor, this is explaind in different game tutorials series). In the individual input key's next slots, add Play Mecanim Animation nodes that use your needed Mecanim setup (e.g. using Play play mode and the names of your states.
    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!
  • Thank you for answer. Happy new Year!
    Tutorial's Survival Shooter is very profitable.

    1:
    Sorry,I want to do that mecanim and texture animation are carried out at the same time.
    I tried ChangeMaterial,but failed. Is ChangeMaterial different?

    2:
    >In the individual input key's next slots
    Where should Animation in Mecanim be assigned?

    This is screenshot.
    image


    Thank you in advance.
  • 1) Make sure you're changing the material on the correct game object and child object of it. I'd need to see the structure of your game object in the scene hierarchy to say more - or you can try using the In Children scope, to change the material on a child renderer.

    2) You need to add an Input Key node to your schematic. You can check multiple input keys there - each input key will have it's own next slot on the node in the editor.
    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!
Sign In or Register to comment.