Quaternion Slerp help

I’ve been looking around and even if I use the exact code people are using I still can’t get this to work for the life of me so I’ve been just working on my own code to no avail

public float speed;
private Transform CurrentPos;

void Start() {
	CurrentPos = transform.rotation;

void OnColisionEnter () 
	CurrentPos = Quaternion.Slerp(CurrentPos, Quaternion.Euler(0,90,0), Time.deltaTime * speed);

I get an error after start on line 5

CurrentPos = transform.rotation;

error CS0029: Cannot implicitly
convert type UnityEngine.Quaternion' to UnityEngine.Transform’

I then get 2 errors on line 10

CurrentPos = Quaternion.Slerp(CurrentPos, Quaternion.Euler(0,90,0), Time.deltaTime * speed);

The best overloaded method match for
UnityEngine.Quaternion, float)’ has
some invalid arguments

error CS1503: Argument #1' cannot convert UnityEngine.Transform’
expression to type

No matter how I try to approach it I get errors, I can’t seem to grasp Quaternion by the looks of it, I have tried setting it to Transform.Rotation,Y = 90 as the target position but I still get errors

I understand that Quaternion uses X,Y,Z,W but it even says on the Scripting API that you can use Quaternion.Euler which gives a Vector3 and you still get an error

I feel unity API could explain these a lot better, from what I’m reading none of the methods seem to work

The following code assumes you’ve already changed to OnCollisionStay, and that this script is attached to whichever object you want to rotate on contact.

public float speed;

private Quaternion targetRotation;

void OnCollisionEnter(){
    //rotation * euler(0,90,0) should give you the current rotation rotated 90 degrees
    targetRotation = transform.rotation * Quaternion.euler( 0, 90, 0 );

void OnCollisionStay () 
    transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * speed);

You’ll notice you don’t really need whatever was in Start(), since calling transform.rotation is basically the same.

EDIT: I just realized something. OnCollisionStay is called every frame something stays in the collider. If you just destroy the colliding object then it makes sense that OnCollisionStay only fires off once and you only rotate for 1 frame.

EDIT 2: Man I don’t know how I totally confused rotations for positions…