Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectMover : MonoBehaviour {
bool isMoved;
Vector3 force = new Vector3(10f, 10f, 0f);
void Start(){
void FixedUpdate(){
if (Time.frameCount < 10){
if (!isMoved){
gameObject.GetComponent<Rigidbody>().AddForce(force, ForceMode.Impulse);
isMoved = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.