Dominoes on Unity

Teaching materials for the school of programming. Part 2

Unity 3D is a modern tool for developing computer games and applications that can be dealt with not only by an adult, but also by a schoolchild. I managed to prove the hypothesis that professional tools can be available to a wide range of users, regardless of age and previous experience, using my own educational project for schoolchildren as an example.





Today, I continue to share materials with you so that the work done by our team will bring maximum benefit to teachers, leaders of children's and youth circles of technical / digital creativity, enthusiastic parents and, of course, children of all ages who dream of becoming developers of computer games!





Spoiler

I would like to remind you that the classes were developed for children 10-16 years old, therefore, many stages are simplified.





You can find the first lesson at the link https://habr.com/ru/post/535916/





Share the tutorials with your friends and colleagues so that as many people as possible know about teaching Unity!





Dominoes

The goal of this lesson is to learn how to create and edit game objects, components, and materials. So, let's begin!





We import the attached asset. You can download it by the link





. quad plane, 200200.





. , .





Spoiler

Unity - . "" Unity. , " , ?" - , , , , .







, Rigidbody, .





Reset, . ( ):





using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Reset : MonoBehaviour {
  Rigidbody rig;
  Vector3 startPos;
  Quaternion startRot;
  
  // Use this for initialization
  void Start() {
    rig = GetComponent<Rigidbody>();
    startPos = transform.position;
    startRot = transform.rotation;
  }
  
  // Update is called once per frame
  void  Update() {
    if(Input.GetKeyDown(KeyCode.Space)) {
      if(rig) {
        transform.position = startPos;
        transform.rotation = startRot;
        rig.velocity = Vector3.zero;
        rig.angularVelocity = Vector3.zero;
      } 
    }
  }
}
      
      







, .

, . Rigidbody.





, , (center / pivot).





, , , 1,5-2 . ( "" ), , , : , , (pitch, yaw, roll), .





, , GameLogic, . ( ).





- -.





At the end of the lesson, the children get a simple game project. Despite the weak visual component (but you can pay attention to textures in your lesson), falling bones cause a storm of positive emotions!












All Articles