playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - elmoeduardo

Pages: [1]
1
Share New Actions / Re: Get Random Point On Sphere
« on: October 21, 2014, 12:22:10 AM »
Started with your code and upgraded it a little.
i actually use it to set random wandering points for an enemy within a certain radius, and it also translates that point to the sphere origin. Hope it helps somebody :) 
Code: [Select]
using UnityEngine;
using System.Collections;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Vector3)]
[Tooltip("Get Random Vector3 from a sphere")]
public class GetRandomPointOnSphere : FsmStateAction
{

[UIHint(UIHint.Variable)]
public FsmVector3 sphereCenter;

[UIHint(UIHint.Variable)]
public FsmFloat sphereRadius;

[UIHint(UIHint.Variable)]
public FsmVector3 storeResult;

public bool everyFrame;

public override void Reset()
{
sphereCenter = null;
sphereRadius = new FsmFloat { UseVariable = true };
storeResult = null;
everyFrame = false;
}

public override void OnEnter()
{
DoGetRandomPointOnSphere();

if (!everyFrame)
Finish();
}

public override void OnUpdate()
{
DoGetRandomPointOnSphere();
}

void DoGetRandomPointOnSphere()
{
Vector3 position;

position = Random.onUnitSphere;
position *= sphereRadius.Value;
position += sphereCenter.Value;

storeResult.Value = position;

}


}
}

2
Windows Phone 8 Help / Invalid Cast Exception on deployment
« on: October 19, 2014, 05:03:59 PM »
Hello, first post over here.
Im using playmaker 1.7.7.f6 Windows Phone 8 Version with almost all the possible addons (playmaker 2D, windows phone, mecanim, itween etc) latest version on all of them. Making the deployment to a device (Lumia 1520) is throwing an invalid cast exception on CallMethod.cs function DoMethodCall() I think that the exception is happening on the storeResult.SetValue(result); line. I have attached a screenshot of the VS solution. Upgrading the project to WP8.1 does not solve the issue.
Any help is greatly appreciated, if you need more info please let me know.
Thanks!

Pages: [1]