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 - krmko

Pages: 1 2 3 [4] 5 6
I was pretty confused when i saw there's only game object tag switch action, so i made Game Object Switch action with not equal event if there's no matches, here you go.


is it safe to edit the asset file in spreadsheet software and save it as an asset file again (while unity's off, of course)? Are the values going to be updated?

I have few hundreds of them and it's getting tedious to mess with them in Unity itself.

I think there'll be no problems, but i better double check :)

Playmaker Help / Handling Simple Animations
« on: June 02, 2017, 04:01:13 AM »
Hello guys,

i thought of posting this to Unity Forums, but they are so complicated there, would probably get some script solutions and my animation in Unity knowledge is quite poor for now so i was hoping from some help from here.

I have a simple weapon switching animation which consists of weapon number 1 pulling into ship wing, and weapon 2 pulling out of ship wing.

There's only one weapon in the gif, but you get the idea.

Making a large number of animations for each weapon switch combination (there are almost 30 of them) is absurd and i'm sure that's not the way to go.

I basically need the object with sprite renderer which represents the weapon to move 10 pixels left until it is hidden, then swap sprite and move 10 pixels right. I'm also not sure if that's the right way to do it too.

Any meaningful ideas? I'm scared of Mecanim, haven't done anything with it yet.

Playmaker Help / Draw Line Action Modification Help
« on: May 30, 2017, 04:29:33 AM »
Hi guys, i think it's better to post it here too, since people are rarely going into share new actions part of the forum. Anywas, since Unity 5.5, you can set the texture mode to tile or stretch on the line renderer, which i really need (actually, everyone who uses line renderer probably needs it).

I tried updating the action, but i get this error:

Assets/PlayMaker Custom Actions/Effects/DrawLine.cs(32,35): error CS0118: `UnityEngine.LineRenderer.textureMode' is a `Unresolved' but a `type' was expected

This is all i added, nothing much really:

31   [Tooltip( "Texture Mode" )]
32   public UnityEngine.LineRenderer.textureMode textureMode;

91   textureMode = UnityEngine.LineRenderer.textureMode.Stretch;
126 _lineRenderer.textureMode = textureMode;
143 _lineRenderer.textureMode = textureMode;

Any ideas, haven't seen this mistake with 'UNRESOLVED', not passing anything i shouldn't as fas as i can tell.

Playmaker Help / Endless Scrolling with a twist!
« on: May 17, 2017, 04:52:06 AM »

i did a 2D scrolling background system, but it needs an upgrade, and i need your help! :)

Here's a neat little graphic to help with explaining:

There are 5 background images of identican dimensions seamlessly connected to one another, first two (Empty Stars 1 and Empty Stars 2) and the last two (Empty Stars 3 and Empty Stars 4) are empty starfield.

The player starts the game on the Empty Stars 2 field, and the background scrolls left to give an illusion of moving right. As the player moves through the level and passes on to the Empty Stars 3 and Empty Stars 4, only those two should loop until the end of the level occurs.

I though of doing it by simply activating the FSM on Empty Stars 3 when it becomes visibile and checking the isVisible state of it. When it's not visible anymore, it relocates by double its width towards right. Same goes for Empty Stars 4.

When the level ends, the hyperspeed state occurs in which the background movement speed increases (and continuously loops through Empty Stars 3 and Empty Stars 4 for an effect of speeding through space), some effects kick in and the screen fades to white.

At that moment, all the background elements are relocated to their original positions so the seamless background loop can be continued. The Full Background image is changed to present another level. During the slowdown to normal speed, Empty Stars 1 and Empty Stars 2 are looped the same way as Empty Stars 3 and Empty Stars 4 when entering hyperspace to avoid looping the Full Background Image. When the speed settles to normal, looping is off, and continues it's normal flow towards the end images. The FSM's for movement, waiting to be seen and relocation are reset and wait for them to be triggered again.

Actually, i wanted to ask the proper way of doing this since i only had a simple variant of it, but as i typed i got it all together lol. But be free to suggest a better solution if you have it.

Playmaker Help / Compare variable range
« on: May 13, 2017, 02:29:39 PM »

i'm making a wave spawn system that should operate the following way:

1.) First spawned wave is by default a small wave category
2.) Spawned ships are added to the array
3.) After a predetermined amount of time, an action gets the number of array items (destroyed and ship that left the screen are removed from the array)
4.) It the number of array items left is 0-5, big wave category is spawned, if the number is 5-10, medium wave category is spawned, if the number 11+, small wave category is spawned.

Using the int switch is a bad idea due to a large number of array items, and conditional expression should have two states (check if it's over 5, if it's false, check if it's over 10). Doesn't sound like much, but this is a simplified example, it will have probably much more to compare.

Any ideas on how i could handle it in one state? Maybe some custom int range switch action?

Hi guys,

i'm using UnibulletHell (!/content/19088) for managing shooting in my little game. The maker of the asset, Hironari, was nice enough to put the Callback Events they can be used to trigger whatever you want when the shot is fired on my request.

I have the need for it to trigger the firing animation on the ship, but i'm not sure how to set it up.

I tried something like this, but it doesn't start the event. I also tried marking it as global but nothing, the event doesn't trigger.

Here's what i've got to select

As far as i can see in the code, it launches a unity event, should i put some sort of listener in the FSM or what? Event Proxy?

Edit: i also tried setstate but it also doesn't seem to work.

I also get his when i select BroadcastEvent

Hello, i've got a strange problem. I've got a weapon upgrade system, here's a shot of it

It's simple, weapons on ship are stored in an array as game objects. When you pick up a weapon, it is checked if any of the levels of the same type of weapon exist in the array. If they do, it is upgraded to the next level. If not, empty weapon slot is filled with the pickup weapon, or if all slots are taken, active weapon is replaced with the pickup.

As you see on the following picture, the weapon type that it is checked for is there, but the state does not go to upgrade, but keeps checking for the next levels, like the variable does not match.

I thought there could be a problem because it is a clone (spawned from pool), but it works perfectly fine when it checks for empty weapon object at the end of the compare loop, which is also a cloned item and the names don't match.

Any ideas?

Btw, here's the shot of the populated array:

Only thing that seems quirky to me is that the array is populated with CLONE 1, and in the array contains action it says CLONE 2.

Things work when i use game object compare, but i don't want it to work that way.

Edit: All good, stupid mistake.


i need to change the alpha of an image that's on the object childed under canvas. It contains rect transform, canvas renderer and Image (UnityEngine.UI.Image) itself.

I tried the following:

Getting the color and storing it under global color variable and changing it on runtime - it doesn't work.
Getting the color and storing it under global float variable and changing it - it doesn't work.

Source image is populated on runtime, of course.

It just doesn't get affected, any ideas?

Playmaker Help / Unity hangs when i enter FSM on runtime [SOLVED]
« on: February 24, 2017, 03:11:43 PM »
This started happening all of a sudden, everything works fine before i hit play, but when i try to enter any FSM on runtime, unity freezes and i have to kill it, so i can't get any crash report.

Unity is 5.5.0f, playmaker latest, any ideas?

Playmaker Help / How to resize game view state labels?
« on: February 24, 2017, 11:58:10 AM »

silly question, but i can't find it in the manual, forum, or anywhere in unity. My game view state labels are to small, any way to resize them?

Action Requests / Using Array list get to store item in multiple variables
« on: February 23, 2017, 03:23:24 AM »
Hello, i was wondering if there was a chance to make an Array List Get action that would allow the item that has been gotten to be stored in multiple variables. More than once i had the need to store the array item as a game object and string for example, and using the action twice really seem unnecessary.

An option to select how many variables would you like to fill would be also cool.

I made a mockup:

I think that would be very useful for many users.

Playmaker Help / Restarting a FSM from another object [SOLVED]
« on: February 19, 2017, 04:19:16 PM »
Hi guys, this is some simple stuff, but i'm not sure what should i use. I have a weapon object which detects whether is it equipped on ship or a pickup drifting in space and based on that the state machine branches further. However, when it is replaced by another weapon, it needs to get back to start state so it can do the weapon/pickup check again.

I can't use reset on exit since i will be activating it from another object. I tried sending an event but it didn't work out, i don't know if i'm doing it right.

The event is global of course.

I tried some debugging, but obviously event has not been received.

Any ideas?

Playmaker Help / Simple problem to be solved with Arraymaker
« on: February 07, 2017, 01:26:11 PM »

I must admit that i've been running away from arrays for some time, but there comes a time when you simply can't do your thing without them. It came for me and i need your help to finally overcome one of the last obstacles in, well, some basic Playmaker functions (after that it's time for enums ;D).

As i said, it is simple but includes using arrays (i have been using them for some VERY basic stuff, nothing more).

Here's a simplified example:

- There are three weapons in the game, let's call them Sword, Axe and Spear.

- Every weapon has three upgrade levels which are basically separate objects. So we have Sword1, Sword2, Sword3, Axe1, Axe2, Axe3, Spear1, Spear2, Spear3.

- Player can only hold two weapons, and use one weapon at a time (let's call it currently active weapon).

- When player holds Sword and Axe and pickups Spear, currently used weapon is replaced by Spear.

- When player holds Sword1 and Axe1 and pickups Sword1, Sword1 is upgraded to Sword2.

How i think it should be done:

I have weapon objects themselves. They spawn on the player and do their thing (fire, deal damage...).

I have pickup objects which are basically empty objects with sprite renderer and collider.

Case 1:

Player is equipped with Axe1 and Sword1, they are added to the Weapons Equipped array - that's simple and i know how to do it.

Player stops on Sword1 pickup and clicks the button to pick it up.

Weapons Equipped array is be checked if it contains Sword1, Sword2 or Sword3. If it contains any of those three, Sword1 weapon object will be destroyed, removed from Weapons Equipped array, Sword2 weapon object will be created on player and added to Weapons Equipped array.

Pickup object will be destroyed.

Case 2:

Player is equipped with Axe1 and Sword1, they are added to the Weapons Equipped array.

Player stops on Spear1 pickup and clicks the button to pick it up.

Array is checked if it contains Spear1, Spear2 or Spear3. There are no such objects in the array, so the currently active weapon object (Sword1 or Axe1) is removed from array and destroyed. Spear1 weapon object will be created on player and added to Weapons Equipped array.

Pickup object will be destroyed.

I tried using the Arraymaker, and i suppose i should use Array Get Next to loop through all the array items, but i don't know how to use it. Ok, i can set it to loop through all of them, and then what? How do i compare the pickup object with all the array items? What does the result represent?

Ok, so there's Array Contains action, but the only way i can think of using it is like this:

- I pick up Sword1 pickup object
- I run Array Contains action and check if the array contains Sword1. If it doesn't the next state which checks is the array contains Sword2 is called, and so on.

Of course, the game is a bit more complicated than the example so it would take a few more events (which means more frames) to check for all weapon objects so i think this is not the right approach and can be done a lot simpler. I watched the Arraymaker GetNext tutorial by RezRezRez, but i don't quite get it, i'm more of a reading than watching guy.

Playmaker Help / Line Renderer Glitch
« on: February 06, 2017, 11:31:36 AM »
Hello guys,

it took me some time to make a functioning line renderer continuous laser beam in a 2D sidescrolling game, but there it is. Unfortunately, a glitch occurs.

Here's how it's setup:

First step is getting the original line renderer X position for later reference.

Standby state, waiting for player to fire the laser beam.

Raycasting with line cast. Hit location is stored to be used for positioning end object for line renderer. Bool test is used to determine if object is hit or not.

Nothing hit, line renders from ship to original end point, everything fine.

We hit something! Magic happens, hit location is converted from vector2 to vector3, line renderer end point is set to hit location, line is drawn, then to loop gets back to raycasting again.

Everything works fine, but two bad things happen.

As you can see, the first thing is that the laser sometimes gets through the object.

Second thing is this:

I separated line casting and the draw line events in different states so the line wouldn't be drawn until the hit position is taken and line renderer end object set on hit position, but it occurs if the first shot did not hit anything. Do you think that i should perhaps put setting the position of line renderer end object in a separate state before firing or maybe use a raycast? Set Position in a different state would cause one frame of lag tho.

Please help, i'm going out of my mind >:(

Pages: 1 2 3 [4] 5 6