Trip wire concept. Rotation woes.

Greetings.
So I’m looking for a little guidance here: I’m making a “trip wire”-esque effect in my 2D game.
Using this ability the player clicks on two spots and my code gets both those spots as vector2s. Easy.

From there I’ve been trying to figure out how I would create a tripwire. So far I have a prefab sprite/collider object that I transform/scale/rotate to fit in that spot.
I figure I get the center of those two points ((pointA + pointB)/2) and translate the object there. Scale is the distance between the two points divided by the size of the sprite.
Rotation currently is vector2.angle(pointA, pointB) and here’s where I run into issues.

void DrawTripWire()
	{
		float angle = Vector2.Angle(pointA, pointB);
		tripWireObject.transform.position = (pointA + pointB) /2;
			
		tripWireObject.transform.eulerAngles = new Vector3(0,0,angle); 
		tripWireObject.transform.localScale = new Vector3( Vector2.Distance(pointA, pointB)/32,0.5f,0);

	}

Regardless of pointA or pointB the object always “faces” the same direction. The left side is always lower than the right. regardless of which is input first or anything.

Any advice? Better way of achieving this?

Thanks
-X

I think I understand what you are trying to achieve.
You are updating the ‘z’ (roll) component of the object’s angle, should the angle be applied to the ‘y’ component instead?

is this game 2d or something? Cause usually you want 3d points.

And usually to get the point in the world they clicked on a surface that is clickable, you calculate a ray at the point on the screen you clicked then cast it into the world and get the point where it hits.

Wow. Lame I replied and it never went through.

Yes it’s a 2D game and I have an easy way to get those points. The issue is with getting the transform of the sprite/collider object to properly line up to those two points.
Z axis is the proper axis in my setup as well.