I have two scenes, called scene 1 and scene 2, with .fbx file.
If I want to change the scene from 1 to 2 when animation of scene 1 end, how should I do?
I have two scenes, called scene 1 and scene 2, with .fbx file.
If I want to change the scene from 1 to 2 when animation of scene 1 end, how should I do?
What type of animation is it??, if you are using animations of unity with animators, then you can add event at the end of animation which will load the next scene.
This can Help You,
https://docs.unity3d.com/Manual/animeditor-AnimationEvents.html
Select the gameobject to which your Animator is attached. Then add the script I wrote for you. Next, go to the Animation Window, look at the timeline and right-click at the keyframe for the clip at the end of which you want your scene to load. Then, from the pop-up menu choose “Add Animation Event”. Alternatively you can add event, as shown at this picture:
You will see a small bar, so left-click it, look at the inspector window and from the dropdown menu choose the function LoadNewScene(). Don’t forget to add your scenes to the Build Settings.
Here’s the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LoadMyScene : MonoBehaviour
{
public void LoadNewScene()
{
UnityEngine.SceneManagement.SceneManager.LoadScene("scene2");
}
}
@yummy81 The script did not work it just comes up as “‘default’ AnimationEvent ‘LoadNewScene()’ has no receiver! Are you missing a component?” and i am using Unity 2018.2.16f1.
Plz help!