Recent Posts

Pages: 1 [2] 3 4 ... 10
Hi guys, i'm having the problem that has been bothering me since the start of the project, and it's time to put it to an end.

Imagine this little fella is a spaceship with an engine jet behind him.


They are separate objects for the reason of only ship changing the color when he is hit (sprite masks are too complicated for this).

When the ship is moving from right to left, i set it's scale properly be getting if he's beyond a certain x position and the jet is rotated towards right. That's ok. When it's moving from left to right, i set the x scale of the ship to -1, the jet detects if engine is -x, and flips too.

But, there are certain situations when the rule is unnaplicable. Like when ship is spawned in the middle of the screen (from a carrier for example), and though the spawn location indicates one jet position, it should be placed on the other side.

There are lots of exceptions, too much to cover in a simple way.

I tried using Get Forward Direction, Get Speed, Get Velocity to get some parameters that could help me out, but i get nothing because the ships are moving either by tweening or by translate.

One idea i'm having is to get the x position of a ship and the position on the next frame and then compare them. If the new float is lower, ship is moving left, if it's higher, then it's moving right and the jet can be rotated accordingly. Unfortunately, this is also unnaplicable for the ship that are rotated either left or right but move only up or down.

Any good ideas on this one, i'm pulling my hair out for months.
Playmaker Help / Re: Observed Component, but which one is it?
« Last post by CoreyHUN on Today at 11:22:33 AM »
bump, anyone?
You could deactivate the "Button Script" component with a "Set Property" action. Just drag the button script component title into a state and choose "enabled" and set it unchecked/false.

You could probably do the same with the "recast target" in the same script.

Sorry, I explained me badly.

What you see is a grid where you can to build by pointing the area with the cursor.
The fact now is the buttons enter in conflict with the placer.
(behind the highlighted button there's the green tile placer).

To proceed I need to avoid the tile placer working while the cursor is pointing an UI element.
You could deactivate the "Button Script" component with a "Set Property" action. Just drag the button script component title into a state and choose "enabled" and set it unchecked/false.

You could probably do the same with the "recast target" in the same script.
Playmaker Help / array find closest inaccurate return
« Last post by mallenroh on Today at 10:43:05 AM »
Im finding the array find closest action is not always returning the actual closest object. Im using to find closest objects in worldspace, but after 10 10 (X Y) it no longer returns what is actually at that position (it returns what is at 8 10 instead)
Hi, It should possible blocking the tile placement while the mouse is pointing the GUI Buttons?

This in Playmaker only, not by scripts.

Maybe someone already asked this? Sorry but the search tab had found nothing.
Playmaker Help / Re: Navmesh agent and mecanim
« Last post by adrian on Today at 07:41:19 AM »
Thank you! Can mark resolved, took some fiddling but this was the root action to fix the issues.
Playmaker Help / EditorMode automated FSM Component Copy-Paste
« Last post by RayCornea on Today at 05:45:57 AM »
Hello, i would want to ask if there's any in editor script for syncing or to quickly copy-paste thru a specified array of gameObjects.

My situation: i have 5 characters with about 10 fsms on each. I plan on having about 40 characters, and manually copy pasting each fsm throughout them all doesn't seem too wise of an option.

ExtraDetails: can't place them into a prefab, since i'm using some trigger and collision events which must stay with the rigidbody gameObject, which has to be on the main parent

Sadly i'm not that good with in editor scripts, so any help is appreciated.
Of course it'd be best to have both options (synch current fsm, synch all fsms from this gameobject to the ones in the array), yet i'd be happy to get at least one of them working.

Progress so far:
As of now i'm only able to select current fsm via "FsmEditor.SelectedFsmComponent", however accesing variables such as arrays, or even doing a "PlayMakerFSM.FindFsmOnGameObject" always has a null result. Is there a certain way to find and access fsms while in Editor mode?

My Code
Code: [Select]
[MenuItem("Tools/Chars FsmSynch")]
public static void FsmSynchCh()
if (ArrHolder == null) ArrHolder = GameObject.Find("SaveLoad");

PlayMakerFSM fsmC = FsmEditor.SelectedFsmComponent;
GameObject gOwner = fsmC.gameObject;

FsmArray gList =  PlayMakerFSM.FindFsmOnGameObject(ArrHolder, ArrFsmname).FsmVariables.GetFsmArray("PrefChars");
if (fsmC != null && gOwner != null && gList.Length > 0) {
FsmS (fsmC, gList, gOwner);

static void FsmS(PlayMakerFSM fsmC, FsmArray gList, GameObject gOwner){
ComponentUtility.CopyComponent (fsmC);
for (int i = 0; i < gList.Length; i++) {
if (gList.Values [i] == null) continue;
if ((gList.Values[i] as GameObject).name == continue;

PlayMakerFSM fsmT = PlayMakerFSM.FindFsmOnGameObject (gList.Values [i] as GameObject, fsmC.FsmName);
if (fsmT != null) ComponentUtility.PasteComponentValues (fsmT);
Action Requests / Re: Activate/Disable Game Component
« Last post by Farwest on February 17, 2018, 01:19:43 PM »
Thanks, however that isn't the solution I am looking for, because Activate Component action in Ecosystem (and others) don't provide same component slots. Kindly if you can check the image you will understand better:

For example in "Destroy Component" action, we choose Game Object and we are able to select the component attached on it. However the action "Activate Component" in Ecosystem don't have similar slots or feature. This is what I request as Action.

If there is a simple way to reach to a specific attached component in "Activate Component" like we do in "Destroy Component", I will appreciate if you can help me. Thanks.
Work In Progress... / Fei and Kitt
« Last post by bazz65 on February 17, 2018, 08:37:45 AM »
Pages: 1 [2] 3 4 ... 10