- Home /
Question by
wolve3000 · Jul 30, 2017 at 02:34 AM ·
collisionrigidbody2dtransform.position
Player can't move on a surface that is moving up fast.
Hello to whoever can help me
I have an elevating bar in my 2D game. Player can walk on that normally without any issue with following code:
void Update()
{
transform.position = new Vector2(transform.position.x, +transform.position.y + Time.deltaTime);
}
But the moment I want it to move upward faster by multiplying Time.deltaTime with a factor of 2 or more. Player cannot move on this elevating bar.
this bar has Rigidbody in Kinematic state.
And this bar prefab is Instantiated in another script as following;
void Start () {
InvokeRepeating("SpawnBars", 0, spawnRate);
}
void SpawnBars()
{
GameObject _elevatorBar = Instantiate(elevatorBar, spawn.position, spawn.rotation) as GameObject;
Destroy(_elevatorBar, 10);
}
can anyone tell me why and solve this problem?
Thank you!
Comment