Hello Guest

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

Pages: [1]
1
Sorry I forgot to mention - yes, the white colour seems to be the sole reason for the problem. Nothing to do with the sprite switch.
And yes, those particles have additive shaders.

Well I learned something new. Thanks!

2
Ok, it appears that the reason is that the new sprite is 100% WHITE.
If I start adding some grey or any other colour, things are getting better. Above 5% grey the problem disappears.

It might be a bug, or something about computer graphics that I don't know   :-\ .

3
Yes, the new sprites have the correct order values in the inspector.
And the order is re-enforced - via code, after the sprite switch.

And I check the particle's layers/orders in runtime with console messages - everything looks fine. They have sorting layer with higher ID and I've tried some outrageous sorting order values as well.

It's really weird.

4
Support / Changing sprite makes the object overlap particle systems
« on: May 17, 2014, 11:30:41 pm »
If I change the sprite of an object with SetSprite(id), that object somehow starts to ignore the sortingOrder and overlaps objects it's not supposed to (particles in this case).

I do set its proper sortingLayer and sortingOrder AFTER the sprite switch (just to be sure) and I check if all values are correct.
And yes, if I don't change the sprite, everything behaves as expected.
The particle systems have higher sortingLayer and are way closer to the camera.

Any advice would be appreciated, thanks!

5
Support / Setting TextMesh's text makes it disappear
« on: April 07, 2014, 11:53:47 pm »
UPDATE: It's resolved. It doesn't seem to work properly if the text mesh is set to update its text upon global events. But it works if you directly modify the text from another object, without sending an event.

So I decided to give Playmaker a shot and i'm trying to change the text of a tk2dTextMesh in runtime, using a "tk2d Text Mesh Set Text" action. But it works ONLY if I check "Everyframe", otherwise the text simply disappears.

Not changing anything else (color, scale, etc) than the text. And I've checked "Commit".

I've used the same action to set the initial values without problem, so I'm sort of confused about what's happening...


6
Support / Re: ParticleSystem textures into a Sprite Collection
« on: March 24, 2014, 12:49:36 pm »
Thanks!
I've separated the particles into their own sorting layer and they are in front of everything so no problems on that front.

7
Support / ParticleSystem textures into a Sprite Collection
« on: March 24, 2014, 12:32:50 pm »
Hello,

I'm looking for a way to reduce the "explosion" of extra draw calls whenever a particle system is played. So I've figured if I could pack all particle textures into a sprite collection, that could help. But unfortunately I don't see a way to set the particle system to get its texture from the sprite collection. Is it possible to use 2D Toolkit's powers to my advantage in this case?

8
Support / Re: Do you work in units or pixels with tk2dToolkit?
« on: March 21, 2014, 12:40:13 pm »
You'll probably find out that mapping 1 pixel to 1 meter leads to some unexpected behaviour from the 2D Physics system - how gravity affects rigidbodies for example. I think this originates from the fact that Box2D uses meters and the docs recommend setting a ratio that corresponds to your game object sizes -> http://box2d.org/2011/12/pixels/.

9
Support / Re: Unreal 4?
« on: March 21, 2014, 12:30:04 pm »
I think it's a great opportunity as there is no equivalent 2D tool on that platform. I'd even go as far and say that this alone could convince me (and many other Unity users) to switch to UE.   

10
Support / Re: Can't make UIItem events to fire my code
« on: February 07, 2014, 11:24:19 am »
Oh yes, the button does the scale down animation and the clicking sound. And the near clipping plane is positive 0.3, far is 25 (took the values from the tutorial). The button itself is at Z: -2, and the camera - at Z: -10. And they all look pretty far from each other in 3D view.

UPDATE: it works now. I just dragged the same object to the Target field (under 'Send Message' in the inspector) and simply picked the method from the list. Object sending message to itself. Still wondering why the code approach didn't work, but everything is fine now.

Thanks again!


11
Support / Can't make UIItem events to fire my code
« on: February 06, 2014, 11:24:43 am »
So I have a regular button (from the demo prefab) and attached the following custom script to it:

Code: [Select]

        private tk2dUIItem uiItem;

void Start () {
uiItem = GetComponent<tk2dUIItem>();
}

void OnEnable()
{
uiItem.OnDown += ButtonDown;
}

void ButtonDown()
{
Debug.Log("Button Down!");
}

... And clicking it doesn't do anything. The collider is ok, and the tk2dCamera has a tk2dUICamera component attached. What am I missing is the question? :) Thanks.

12
Support / How to get standard Input touches for UIItem's?
« on: January 25, 2014, 06:50:03 pm »
So I want to control the game character's movement with a simple two-directional pad - just two onscreen arrow elements/buttons next to each other. Tried the demo UI button examples, but the available events don't satisfy my needs unfortunately. The user should be able to slide between the two sprites without lifting her finger and the OnDown event doesn't get fired in this case. Also, it's a one time event and I need to execute some code for as long as the screen is being touched.

It would be enough if I can just get the standard unity Input touches (http://docs.unity3d.com/Documentation/ScriptReference/Input.GetTouch.html) that are applied over the sprite colliders (or just the sprites), so if you could give me some directions how to do that, I should be ok. Of course, any alternative ideas are welcome. Thanks.

PS: I saw the regular way to create such control element in Unity is by using GUITexture, but was wondering If I can utilise some of the TK2D features instead..

13
Support / Re: After I updated Unity to 4.3 and 2D Toolkit to 2.3...
« on: November 13, 2013, 12:20:18 pm »
Thanks, that helped!

14
Support / Re: After I updated Unity to 4.3 and 2D Toolkit to 2.3...
« on: November 13, 2013, 11:30:04 am »
Yes, but only from my own scripts - the same I had before updating.

15
Support / After I updated Unity to 4.3 and 2D Toolkit to 2.3...
« on: November 13, 2013, 11:22:49 am »
Hello,

Probably I've messed up something but after updating both Unity and 2D Toolkit my project doesn't look like a 2d TK project at all  :o These are the symptoms:

  • All 2D Toolkit scripts that are attached to prefabs and objects display this: "The associated script cannot be loaded. Please fix any compile errors and assign a valid script."
  • Doesn't display any of the 2D Toolkit features that were previously built into the Unity menu - Create a Sprite, Create Sprite Collections, etc.

To update 2D TK I just opened the asset store window from within Unity and clicked Update, then Import.

Thanks in advance!

Pages: [1]