У нас вы можете посмотреть бесплатно Unity / Playmaker Tutorial - Trigger Animation - Sliding Doors или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
This tutorial will show you how to create a simple sliding door animation (legacy) and then trigger it when the player comes close to it in Unity. Some basic aspects of the tutorial are time-lapsed for convenience. 1. Create a new project and new scene in Unity and import the Playmaker package (http://www.hutonggames.com/ or Asset store) 2. Create a floor and two walls beside each other with a gap in the middle for a door 3. Make sliding doors from two cubes, one half on each side in between the two walls 4. Create an empty object and place it in front of the sliding doors 5. Rename the left side of the door to ‘DoorL’ and the right side to ‘DoorR’ 6. Make the two sides of the door children of the empty object. Rename it to ‘DoorParent’ 7. Select ‘DoorParent’ and open the ‘Animation’ window 8. Choose ‘Create New Clip’. Rename it to ‘DoorIdle’ 9. Click the small arrows and choose ‘Create New Clip’ and rename this one to ‘DoorOpen’. Click ‘Add Property’ 10. In the timeline, go to 1 second and drag the right door to the right so it is open 11. Repeat for the left door and you should see the keyframes added automatically in the animation window 12. Click ‘Create New Clip’ again and rename this one to ‘DoorClosed’. Click ‘Add Property’ 13. In frame 1, open the doors and at 1 second, have them closed again. 14. In your assets folder you will see the animations that you just created 15. Click on ‘DoorClosed’ and in the Inspector panel, click on the icon in the top right 16. Select ‘Debug’ from the dropdown menu and then make sure the ‘Legacy’ box is checked 17. Repeat this for ‘DoorIdle’ and ‘DoorOpen’, making sure ‘Legacy’ is checked each time 18. Select the ‘DoorParent’ object. In the Inspector panel, remove the ‘Animator’ component 19. Click ‘Add Component’ and choose ‘Physics – Box Collider’. Tick the ‘Is Trigger’ check box 20. Resize and reposition the box collider so that it is in front of your sliding doors 21. Import the Character package and add a First Person Controller to the scene 22. Select the ‘DoorParent’ object and add a new FSM in Playmaker 23. Add a ‘TriggerEnter’ transition to state1. Add a new state and add a ‘TriggerExit’ transition 24. Add one more state and add a ‘Finished’ transition. Connect State1 to 2 and 2 to 3 and 3 back to 1 again. 25. Test the game to see if the trigger is working. Make sure your doors are not touching anything else or the state will automatically trigger to State 2. Move to the door to test. 25. Select State 2 and add a ‘Play Animation’ action from the Playmaker Actions panel 26. You will notice a warning ‘GameObject requires Animation component!’ Click the warning. 27. Go to the Inspector and look at the ‘Animation’ component that has been added 28. In the ‘Animation’ field, drag the ‘DoorIdle’ animation from the Assets panel 29. Change ‘Animations – Size’ to 3. Change Element1 to DoorOpen and 2 to DoorClosed 30. Make sure the ‘Play Automatically’ box is unchecked or else the animation will just start playing by itself 31. Select State2 and go back to the ‘Play Animation’ action in the Playmaker editor window. 32. Beside ‘Anim Name’ use the drop down menu icon to select ‘DoorOpen’ 33. Select State 3 and add a ‘Play Animation’ action. Beside ‘Anim Name’ choose ‘DoorClosed’ 34. Test the game and when you go to the door it will open. When you leave it will close.