I made the following script in bolt where the Platform moves down and up perfectly. But when the Player Stands on the object the platform falls like a light Wooden plank. I mean it can not handle the wait of the player. It falls in ground. I don’t know how to move object without RigidBody. It would be better if i could get answer in Bolt. But solution in C# will also help.
@yuvaansh Thanks for answering.
I copied pasted your exact script but I got a lot of console errors (see image 1). I am complete new in C#.
But I tried to convert the script in bolt ( see images 2
@adityajaix
I think you should create a moving platform script (C#) and then attach to your platform. You can use this code.
[SerializeField] private Transform targetA, targetB;
private float speed = 1f; //Change this to suit your game.
private bool switching = false;
void Update()
{
if (!switching)
{
transform.position = Vector3.MoveTowards(transform.position, targetB.position, speed * Time.deltaTime);
}
else if (switching)
{
transform.position = Vector3.MoveTowards(transform.position, targetB.position, speed * Time.deltaTime);
}
if (transform.position == targetB.position)
{
switching = true;
}
else if (transform.position == targetB.position)
{
switching = false;
}
}
Also on your player it would be a bit jerky so to fix this try make it so that on your player script it shuld be void FixedUpdate instead of Update as FixedUpdate runs every physics frame and Update runs every frame.
I hope this would move that platform and help you :>)