Debug.drawRay not pointing in correct direction

Hello. I have and object and i would like to have a Debug.drawRay point in the same direction of the object the current code draws a line but it always points towards world x direction.This is the current code:

var xOffset : int = 6356; var forward : Vector3; function Update() { forward = transform.rotation.eulerAngles; forward.x = xOffset; Debug.DrawRay(transform.position, forward,; }

if i don’t have the forward.x = xOffset then the ray points upwards. the line must only change on the y direction since its a 2D game. Thanks for your help.

function Update () {
Debug.DrawRay(transform.position, transform.forward,;