Read Time:29 Second
Title
How To Add Force To An Object In Unity | Learn Unity | Game Development Tutorial 7 Urdu/Hindi
Content
- Add 3D GameObject
- Change Material Of GameObject
- Add Rigibody Component
- Create A C# Script
- Write Code In Script or Download Script From Below Button
- Make Camera Child Of GameObject For Camera Tracking
Code
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Force : MonoBehaviour { private void FixedUpdate() { GetComponent().AddForce(transform.forward * 5 * Time.deltaTime); } }
Average Rating