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.


Topics - coxy17

Pages: 1 [2] 3 4 ... 6
16
PlayMaker Help / PlayMakerHashTableProxy get key error [SOLVED]
« on: June 07, 2017, 05:52:32 AM »
Hi

I am using the ArrayMaker and HashTables script and i am using the following code and i get an error message.
Code: [Select]
Debug.Log (GetComponent<PlayMakerHashTableProxy>().hashTable["test"]);
error
Quote
NullReferenceException: Object reference not set to an instance of an object
CharacterSelectionScreenNGUI.OnEnable () (at Assets/Scripts/MLM/CharacterSelectionScreenNGUI.cs:10)
UnityEditor.DockArea:OnGUI()

if i check the hashtable prefill count i get a value, so just seems i cant reference a key or value from a hashTable.
Code: [Select]
Debug.Log (GetComponent<PlayMakerHashTableProxy>().hashTable.preFillCount);
Why do i get this message?

full code
Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;

[ExecuteInEditMode]
public class CharacterSelectionScreenNGUI : MonoBehaviour
{

void OnEnable () {

Debug.Log (GetComponent<PlayMakerHashTableProxy>().hashTable["test"]);
}

}


17
PlayMaker Help / Change the name of global variables
« on: April 20, 2017, 01:19:27 AM »
Hi

I know that the option to change global variable names is disabled at the moment but does anyone know when this will be added in as a option?

Nick

18
PlayMaker Help / FSM removing script auto adds back in after runtime
« on: February 18, 2017, 10:03:57 AM »
I have loads of prefabs with the same FSM attached that uses a playmaker template. I was using a OnTriggerStay and then decided to remove it. When i removed this and then clicked apply on the prefab and template to update it worked for the current prefabs in the scene, but when i reloaded the scene it re-appears in the inspector showing i am using a OnTriggerEnter. When im not, ive only got one FSM on the prefab and checked made sure it doesnt exist in the template anywhere.

What is still appearing is the script (onTriggerEnter) at the bottom of the inspector (screenshot)

i have got 1000s of these prefabs and i dont want to make a new one just to remove this!

Nick

19
PlayMaker Help / Enable FSM on all children[SOLVED]
« on: February 10, 2017, 04:45:27 AM »
Hi

I am using the EnableFSM in the playmaker actions to enable/disable based on manually targeting a FSM. Is there a way to do this for all child objects of the parent too?

https://hutonggames.fogbugz.com/default.asp?W55

Nick

20
PlayMaker Help / Activate/Deactivate game objects and garbage in profiler
« on: February 03, 2017, 03:48:23 AM »
Hi

I have read around the forum but cant find an answer, i have a Activate/Deactivate script on the parent of a platform which i just want to disable. Im testing using Unity remote on an android when i noticed a spike (attached screenshot) in the 'PlaymakerFSM.OnDisable'. Any ideas why this is?

The moving platform has a RigidBody with Kinematic enabled and all children just have OnTriggerEnter scripts on them. Any ideas?


also attached a onTriggerEnter screenshot


also i created a new scene and added just a box with child objects and i can get the same issue. Deep profile screenshot attached (3rd)


Nick


21
PlayMaker Help / Total number of scripts in scene and performance
« on: February 01, 2017, 01:41:36 AM »
Hi

I just wanted to ask, i have over 1300 scripts in my scene and i am optimising my scene for mobile, the fps is a little low but i was wondering is it a good idea to disable loading of FSM's until the player is close to the object. Kind of like LOD works.

Or is there another way?

Nick

22
PlayMaker Help / NGUI Events to Playmaker FSM Spike Garbage Issue
« on: January 29, 2017, 03:57:51 PM »
Hi,

Im using NGUI and Playmaker, im not sue if to ask on here or on NGUI forum, but im using the script to send events from NGUI to playmaker and i noticed a spike in garbage when using this. Im not sure whats causing this garbage collection in the script?

I am testing in Unity profiler on the mobile device using Unity Remote 5. It happens on any OnPress events and i have limited NGUI to its own layer and have the clear flags set to depth only.

Nick


23
PlayMaker Help / Changing sprite per second and touch detect [SOLVED]
« on: October 19, 2016, 10:34:29 AM »
Hi

I'm after creating a constantly changing image  (sprite) with various images. But only showing 1 per second. Then when the user clicks the screen I need to detect which sprite was visible upon touch.

I know how I can do the touch detect.  I just need help with the best approach to switching the sprite images quickly and stopping upon touch. Any help would be great

Nick

24
PlayMaker Help / Size of scene file for android game
« on: September 22, 2016, 02:28:10 PM »
Hi

Im creating a android game and i have a plan to have loads of levels (over 100). My scene size is averaging around 220KB and i have a scene per level. So around 22MB for 100 levels/scenes if im right. my mission long term is to go to 300 scenes eventually so it will be quite big. Is this under or over the average for android?

other assets and scenes add up to around 37MB. So in all after 100 levels i will have around 59MB.

Nick

25
PlayMaker Help / Record player movement / path
« on: August 16, 2016, 12:26:59 AM »
Hi

I currently have a game where i would like to record and store the path it took. Ive looked into 'Trail Renderer' but i'm after a Playmaker equivalent.

Ive seen this on the asset store 'https://www.assetstore.unity3d.com/en/#!/content/10236 but no playmaker :( Are there any other ways you can get a line to follow a player, store it and then use it later on?

Nick

26
PlayMaker Help / Raycast and compare facing direction [SOLVED]
« on: August 12, 2016, 06:39:12 AM »
Hi

I have a 3d game where the player moves one space at a time, the player at some point raycasts against a trigger which needs to compare its up vector to that of my players, then do an action. So if the player is upside own when approaching it will do one action, if the player is facing up to the trigger it will do another action etc.

Ive attached a screenshot with 2 examples of how i think i could achieve it, but im not sure what the best method is for this?

Nick

27
PlayMaker Help / Custom Script Lerp speed issue [SOLVED]
« on: August 06, 2016, 04:41:03 PM »
hi

i have the following script which works so far to follow a gameobject. I just cant get one part of it to work with playmaker FSM. The script works fine before i started writing this script.

the problem is only with the time on line 97 and where it has... 0.1f
Quote
ownergameobject.transform.rotation  = Quaternion.Lerp (targetRotation.Value, targetgameobject.transform.rotation, 0.1f * Time.deltaTime);

Whatever i specify in this e.g. from 0.1 to 0.9 i cant get a delay to work. it seems to be ignoring the value. Not sure why? this works out of playmaker so i guess its something to do with playmaker causing this.

Nick

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2016. All rights reserved.
// Action made by NCMedia
// Rotate Player Over Time
// __ECO__ __PLAYMAKER__  __ACTION__

using UnityEngine;
using System.Collections;

namespace HutongGames.PlayMaker.Actions
{

[ActionCategory(ActionCategory.Transform)]
[Tooltip("This will transform rotate an object over a set time")]

public class RotateOverTime : FsmStateAction {

[RequiredField]
[Tooltip("Game Object to move")]
public FsmOwnerDefault owner; //owner

[RequiredField]
[Tooltip("Game Object to target")]
public FsmOwnerDefault target; //owner

[Tooltip("speed")]
public FsmFloat speed;

public FsmVector3 offsetPosition;

public Space offsetPositionSpace;

public bool lookAt = false;
public FsmQuaternion targetRotation;

private Vector3 lookAtPos;
private Vector3 lookAtPosWithVertical;
private FsmVector3 upVector;

public PlayMakerActionsUtils.EveryFrameUpdateSelector updateType;


public override void Reset()
{
owner = null;
target = null;
speed = 0.1f;
offsetPosition = null;
lookAt = false;
offsetPositionSpace = Space.Self;
targetRotation = new FsmQuaternion { UseVariable = true };
upVector = new FsmVector3 { UseVariable = true};
updateType = PlayMakerActionsUtils.EveryFrameUpdateSelector.OnUpdate;
}

public override void OnEnter()
{
DoFollowObject();
}


public override void OnUpdate()
{
if (updateType == PlayMakerActionsUtils.EveryFrameUpdateSelector.OnUpdate)
{
DoFollowObject();
}
}

void DoFollowObject () {

var ownergameobject = Fsm.GetOwnerDefaultTarget(owner); //get object
var targetgameobject = Fsm.GetOwnerDefaultTarget(target); //get target



// compute position
if(offsetPositionSpace == Space.Self)
{
ownergameobject.transform.position = targetgameobject.transform.TransformPoint(offsetPosition.Value);
}
else
{
ownergameobject.transform.position = targetgameobject.transform.position + offsetPosition.Value;
}

// compute rotation
if(lookAt)
{
ownergameobject.transform.LookAt(lookAtPos, upVector.IsNone ? Vector3.up : upVector.Value);
}
else
{
//ownergameobject.transform.rotation = targetgameobject.rotation;

targetRotation.Value = targetgameobject.transform.rotation;

ownergameobject.transform.rotation  = Quaternion.Lerp (targetRotation.Value, targetgameobject.transform.rotation, 0.1f * Time.deltaTime);

}



}

}
}

28
PlayMaker Help / Itween Rotate Update Physics Object Issue
« on: August 02, 2016, 03:26:15 PM »
Hi

I am using ItweenRotateUpdate to make my camera follow the player. It works when the player is facing World up. But when its not it causes the angle to behave strangely. Is like it does it in a curve instead of a linear line. My player turns 30 degrees at a time. So its jerky when Y axis doesn't match World Y axis. 

See attached screenshot for my setup.

I have tried ItweenRotateUpdate2 with 'late update' enabled and this didnt behave any differently. Any ideas what i can try now?

Thanks

Nick

29
PlayMaker Help / Custom Script Reset Vector3 help
« on: July 28, 2016, 12:44:12 PM »
Hi

I am writing a custom script to rotate the player at a speed. But the FSM works but how can i rest the Vector3 back to zero. On exit?

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2016. All rights reserved.
// Action made by NCMedia
// Rotate Player Over Time
// __ECO__ __PLAYMAKER__  __ACTION__

using UnityEngine;
using System.Collections;

namespace HutongGames.PlayMaker.Actions
{

[ActionCategory(ActionCategory.Transform)]
[Tooltip("This will transform rotate an object over a set time")]

public class RotateOverTime : FsmStateAction {

[RequiredField]
[Tooltip("Game Object to move")]
public FsmOwnerDefault gameObject; //owner


[RequiredField]
[Tooltip("time taken to rotate")]
public FsmFloat time;

[RequiredField]
[Tooltip("how far to rotate")]
public FsmFloat rotation;

public Vector3 targetAngles;

public PlayMakerActionsUtils.EveryFrameUpdateSelector updateType;


public override void Reset()
{
gameObject = null;
time = 1f;
rotation = 1f;
updateType = PlayMakerActionsUtils.EveryFrameUpdateSelector.OnUpdate;
}


public override void OnUpdate()
{

if (updateType == PlayMakerActionsUtils.EveryFrameUpdateSelector.OnUpdate)
{
DoRotateOverTime();
}

}

void DoRotateOverTime()
{

var owner = Fsm.GetOwnerDefaultTarget(gameObject); //get owner

if(Input.GetKeyDown(KeyCode.S)) // some condition to rotate
targetAngles = owner.transform.eulerAngles + rotation.Value * Vector3.up; // what the new angle should be

owner.transform.eulerAngles = Vector3.Lerp(owner.transform.eulerAngles, targetAngles, time.Value * Time.deltaTime); // lerp to new angle

if(owner.transform.eulerAngles == targetAngles)
{

Finish();
}
}
}
}

30
PlayMaker Help / get a list of products [SOLVED]
« on: July 25, 2016, 12:59:56 AM »
Hi

I have searched around but confused with all of the ideas with what i am seeking to do. I want to create a large list of products (name and price) and then be able to use a search box to query them and return a list of items? what would be the best approach for this? Linq or arraylist? or none of them.

Cheers

Nick

Pages: 1 [2] 3 4 ... 6