- Home /
Question by
UniluckStudios · Aug 09, 2017 at 05:52 AM ·
movementrigidbody2dvelocityvector2constant
Object jitters when the scene starts
In my game, I am using a square with a rigidbody2d attached to it. I want the square to move along the y axis when the scene starts at a constant speed. The problem is that when the scene starts, the square moves a little, pauses for a split second, and then moves smoothly for the rest of the way. How would I keep the square from pausing at the start?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AddForce : MonoBehaviour {
// Use this for initialization
public float thrust;
public Rigidbody2D rb;
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
void FixedUpdate()
{
}
void Update () {
rb.velocity = new Vector2 (0, -1) * thrust;
}
}
Comment
Your answer
Follow this Question
Related Questions
Character won't move (Fixed) 1 Answer
Need some help with my dash move 1 Answer
Moving game object have different speeds in different screen resolutions and it's jittering 1 Answer
Limited movement in the air 1 Answer
Stuttering/jerky movement of kinematic rigidbody 2d moving by velocity in 2D game on iOS 0 Answers