Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetBezierPointerApperance.cs(67,44): error CS0029: Cannot implicitly convert type float' to UnityEngine.Vector2' #3

Open
jiadong-deng opened this issue May 3, 2017 · 4 comments

Comments

@jiadong-deng
Copy link

Assets/VRTK_Playmaker3x/Pointer/PointerRenderers/BezierPointer/SetBezierPointerApperance.cs(67,44): error CS0029: Cannot implicitly convert type float' to UnityEngine.Vector2'

@mavers74
Copy link

mavers74 commented Aug 1, 2017

Same problem here...

@ericvanderwal
Copy link
Owner

Sorry, I missed this one. I am pushing commits now for version 3.3.0 in the master. I created a branch for 3.2.0, which should help solve your issue.

@ericvanderwal
Copy link
Owner

ericvanderwal commented Aug 14, 2017

PS, if you are still having the issue. Simply delete that action and replace it with this one.

// Custom Action by DumbGameDev
// www.dumbgamedev.com
// Version two of this action. MaximumLength was changed from a float to a Vector2 per changes in VRTK 3.1.0

using UnityEngine;
using VRTK;

namespace HutongGames.PlayMaker.Actions
{
	[ActionCategory("VRTK Pointer")]
	[Tooltip("Set Bezier Pointer apperance.")]

	public class SetBezierPointerApperance : FsmStateAction
	{
		[RequiredField]
		[CheckForComponent(typeof(VRTK.VRTK_BezierPointerRenderer))]    
		public FsmOwnerDefault gameObject;

		public FsmVector2 maximumLength;
		public FsmInt tracerDensity;
		public FsmFloat cursorRadius;

		public FsmBool everyFrame;

		VRTK.VRTK_BezierPointerRenderer theScript;

		public override void Reset()
		{

			tracerDensity = null;
			cursorRadius = null;
			gameObject = null;
			everyFrame = false;
		}

		public override void OnEnter()
		{
			var go = Fsm.GetOwnerDefaultTarget(gameObject);


			theScript = go.GetComponent<VRTK.VRTK_BezierPointerRenderer>();

			if (!everyFrame.Value)
			{
				MakeItSo();
				Finish();
			}

		}

		public override void OnUpdate()
		{
			if (everyFrame.Value)
			{
				MakeItSo();
			}
		}


		void MakeItSo()
		{
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (go == null)
			{
				return;
			}

			theScript.maximumLength = maximumLength.Value;
			theScript.tracerDensity = tracerDensity.Value;
			theScript.cursorRadius = cursorRadius.Value;
		}

	}
}


@mavers74
Copy link

Thanks a lot! I'll check asap and let you know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants