Hover over highlighted keywords to see educational tooltips. Perfect for annotating Unity scripts for students.
1using UnityEngine;2using System.Collections;34public class PlayerController : MonoBehaviour5{6 [SerializeField]7 private float moveSpeed = 5.0f;8 9 private Rigidbody rb;10 private Vector3 moveDirection;11 12 void Start()13 {14 rb = GetComponent<Rigidbody>();15 Debug.Log("Player controller initialized");16 }17 18 void Update()19 {20 HandleInput();21 MovePlayer();22 }23 24 private void HandleInput()25 {26 float horizontal = Input.GetAxis("Horizontal"); // Let's see how comments 27 float vertical = Input.GetAxis("Vertical"); // Work out!28 29 moveDirection = new Vector3(horizontal, 0, vertical).normalized;30 }31 32 private void MovePlayer()33 {34 if (moveDirection != Vector3.zero)35 {36 Vector3 velocity = moveDirection * moveSpeed;37 rb.velocity = new Vector3(velocity.x, rb.velocity.y, velocity.z);38 }39 }40}1using UnityEngine;2using System.Collections;34public class PlayerController : MonoBehaviour5{6 [SerializeField]7 private float moveSpeed = 5.0f;8 9 private Rigidbody rb;10 private Vector3 moveDirection;11 12 void Start()13 {14 rb = GetComponent<Rigidbody>();15 Debug.Log("Player controller initialized");16 }17 18 void Update()19 {20 HandleInput();21 MovePlayer();22 }23 24 private void HandleInput()25 {26 float horizontal = Input.GetAxis("Horizontal"); // Let's see how comments 27 float vertical = Input.GetAxis("Vertical"); // Work out!28 29 moveDirection = new Vector3(horizontal, 0, vertical).normalized;30 }31 32 private void MovePlayer()33 {34 if (moveDirection != Vector3.zero)35 {36 Vector3 velocity = moveDirection * moveSpeed;37 rb.velocity = new Vector3(velocity.x, rb.velocity.y, velocity.z);38 }39 }40}beginnerTooltips - Basic C# conceptsunityBasicsTooltips - Essential Unity conceptsunityIntermediateTooltips - Intermediate Unity featuresunityAdvancedTooltips - Advanced Unity topicscsharpFundamentalsTooltips - Advanced C# conceptsgameDevPatternsTooltips - Game development patternsbeginnerUnityTooltips - Perfect for new Unity developersintermediateUnityTooltips - For students with some experienceadvancedUnityTooltips - For advanced topics and editor scriptinggameDevTooltips - Focus on game development patternscomprehensiveTooltips - Everything combined