i have a 2d platformer game and i have a “slippery” slope that i want the player to slide down very fast. I place the physics material “ice” on it and it slides down but its not fast enough. What would be the best idea to accomplish this and how would i do it? thnx
You would need to create a collider to represent the area the player needs to be in to get this effect and then set the collider to a trigger.
Read these:
You probably would want to do something like:
void OnTriggerEnter(Collider other)
{
Vector3 force = other.rigidbody.velocity.normalized * howmuchtospeedup;
other.rigidbody.AddForce(force, ForceMode.VelocityChange);
}
ForceMode.VelocityChange may or may not be the best for your purposes, experiment with the other forcemodes for the results you’re looking for.
You are using a rigidbody for the character? If so just increase the speed of the character when he’s on a “slippery slope.”