Home Unity

Help with Unity

Attempting to import custom made assets into Unity (Used Maya and 3DS Max for this particular situation). I've exported the assets form Maya/3DS Max with it exporting as Meters. When I go into Unity and import it into Unity, change the scale from 0.01 to 1, and drag into the hierarchy, it shows up invisible. I do not know why, but I can not for the life of me get my assets to show up.

Replies

  • Zodd
    Offline / Send Message
    Zodd polycounter lvl 11
    Have you checked for flipped normals ? that may be the case depending on geometry but you should be able to see something. Also not sure but shouldn't you drag and drop onto scene ?
    Also try selecting the object in question in hierarchy and then press F ( works same as in maya)
    that should frame the object.
    Also Also :) try checking textured with wireframe in the project viewport, while doing this so you can be sure that the object is indeed present in the world.
  • EdwardsNT
    I was able to figure everything out, for some reason, it wasn't an editable polygon, so I imported into 3ds max, converted to editable poly, exported out and everything worked just fine!
  • EdwardsNT
    I do have another issue now.

    I am trying to create an animation for a door to slide down under the plane and come back up after a few seconds. The animation as intended when I check the animator box on my door, but when I uncheck it, it does not work.

    I have a cube set up as a collider for an on trigger with the imported unity script to activate a trigger. Also have the animation on my door already.


    http://imgur.com/6cZsWhe,O80VeqI#0 is my trigger and http://imgur.com/6cZsWhe,O80VeqI#1 is my actual door.

    Any help is much appreciated!
  • Zodd
    Offline / Send Message
    Zodd polycounter lvl 11
    Any help coming right up :)

    Can't really understand the problem here, also i have very basic knowledge of unity scripting but, isn't it supposed to act that way? I mean the door have animation right? and it is checked ( enabled ) and it works while enabled, so if i understood the problem correctly ( which i don't think i did :) ) everything is working as it should be.
    From screenshots it looks fine too, collider has target and source plugged in correctly.
    Maybe check the scripts manual if it exists, or try and open it maybe it has some sort of instructions on how to use it that is commented out ?
  • MikeF
    Offline / Send Message
    MikeF polycounter lvl 19
    That should be a pretty straightforward setup, you can simplify it by putting the collider on the animated door itself.

    Code would be something like this (pseudo code):

    var DownStateDelay : float = 3.0f;

    function OnTriggerEnter (other : Collider) {
    if(other.gameObject.tag == "Player")
    {
    animation.play("DoorOpen");
    yield WaitForSeconds (DownStateDelay);
    animation.play("DoorClose");
    {
    }
  • EdwardsNT
    Putting a collider on the door also did not work it seems like. :(


    This is the script I have for my "Activate Trigger"



    public class ActivateTrigger : MonoBehaviour {
    public enum Mode {
    Trigger = 0, // Just broadcast the action on to the target
    Replace = 1, // replace target with source
    Activate = 2, // Activate the target GameObject
    Enable = 3, // Enable a component
    Animate = 4, // Start animation on target
    Deactivate= 5 // Decativate target GameObject
    }

    /// The action to accomplish
    public Mode action = Mode.Activate;

    /// The game object to affect. If none, the trigger work on this game object
    public Object target;
    public GameObject source;
    public int triggerCount = 1;///
    public bool repeatTrigger = false;

    void DoActivateTrigger () {
    triggerCount--;

    if (triggerCount == 0 || repeatTrigger) {
    Object currentTarget = target != null ? target : gameObject;
    Behaviour targetBehaviour = currentTarget as Behaviour;
    GameObject targetGameObject = currentTarget as GameObject;
    if (targetBehaviour != null)
    targetGameObject = targetBehaviour.gameObject;

    switch (action) {
    case Mode.Trigger:
    targetGameObject.BroadcastMessage ("DoActivateTrigger");
    break;
    case Mode.Replace:
    if (source != null) {
    Object.Instantiate (source, targetGameObject.transform.position, targetGameObject.transform.rotation);
    DestroyObject (targetGameObject);
    }
    break;
    case Mode.Activate:
    targetGameObject.SetActive(true);
    break;
    case Mode.Enable:
    if (targetBehaviour != null)
    targetBehaviour.enabled = true;
    break;
    case Mode.Animate:
    targetGameObject.GetComponent<Animation>().Play ();
    break;
    case Mode.Deactivate:
    targetGameObject.SetActive(false);
    break;
    }
    }
    }

    void OnTriggerEnter (Collider other) {
    DoActivateTrigger ();
    }
    }
  • MikeF
    Offline / Send Message
    MikeF polycounter lvl 19
    This is way overboard for something as simple as opening and closing a door.
    Create a new javascript, paste in what i posted above, make sure your player is tagged as "Player" (or just remove the if statement if you want anything to trigger it) and you should be good to go
Sign In or Register to comment.