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

Pages: [1] 2 3 ... 13
1
General Discussion / Re: Doodle Jump like smooth movement
« on: October 20, 2018, 10:17:04 AM »
Hmmm, I still can't get it to do anything. 
I simply set it to ignore player and platform collisions to try it but still he keeps bouncing on the platform.
What should I try to find the/my problem?

2
The Vector2Interpolate does not fire the FinishEvent in case the InterpolationType is set to EaseInOut.
Firing the FinishEvent works in case the InterpolationType is set to Linear.

I guess this part has the bug:
storeResult.Value = Vector2.Lerp(fromVector.Value, toVector.Value, weight);
         
         if (weight > 1)
         {
            if (finishEvent != null)
               Fsm.Event(finishEvent);

            Finish();
         }

It says
if (weight > 1)

But here:
https://docs.unity3d.com/ScriptReference/Vector2.Lerp.html
it says that weight can only be 0-1 so

if (weight > 1)
should be, right?
if (weight >= 1)

.... I felt brave as I was writing this, tried it out and LOL it works with that modification.

br,
szomaza

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2016. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Vector2)]
[Tooltip("Interpolates between 2 Vector2 values over a specified Time.")]
public class Vector2Interpolate : FsmStateAction
{
[Tooltip("The interpolation type")]
public InterpolationType mode;

[RequiredField]
[Tooltip("The vector to interpolate from")]
public FsmVector2 fromVector;

[RequiredField]
[Tooltip("The vector to interpolate to")]
public FsmVector2 toVector;

[RequiredField]
[Tooltip("the interpolate time")]
public FsmFloat time;

[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("the interpolated result")]
public FsmVector2 storeResult;

[Tooltip("This event is fired when the interpolation is done.")]
public FsmEvent finishEvent;

[Tooltip("Ignore TimeScale")]
public bool realTime;

private float startTime;
private float currentTime;

public override void Reset()
{
mode = InterpolationType.Linear;
fromVector = new FsmVector2 { UseVariable = true };
toVector = new FsmVector2 { UseVariable = true };
time = 1.0f;
storeResult = null;
finishEvent = null;
realTime = false;
}

public override void OnEnter()
{
startTime = FsmTime.RealtimeSinceStartup;
currentTime = 0f;

if (storeResult == null)
Finish();
else
storeResult.Value = fromVector.Value;
}

public override void OnUpdate()
{
// update time

if (realTime)
{
currentTime = FsmTime.RealtimeSinceStartup - startTime;
}
else
{
currentTime += Time.deltaTime;
}

float weight = currentTime/time.Value;

switch (mode) {

case InterpolationType.Linear:
break;

case InterpolationType.EaseInOut:
weight = Mathf.SmoothStep(0, 1, weight);
break;
}

storeResult.Value = Vector2.Lerp(fromVector.Value, toVector.Value, weight);

if (weight > 1)
{
if (finishEvent != null)
Fsm.Event(finishEvent);

Finish();
}

}
}
}

3
General Discussion / Re: Doodle Jump like smooth movement
« on: October 15, 2018, 10:10:08 AM »
Hi djaydino,

I just tried your above 2 ideas and they worked perfectly to solved my problem:

1. using the SetLayer action to set it for the player to a non-colliding layer for the time it is teleported to the other side.
2. EnableCollider2D also works the same way.

Both needed a 0.1 sec. wait before turning them back on after the teleport. One frame wait was not enough and it also occasionally glitched (teleporting the player back and forth) with only 2 frame wait.

I also tried your action but it does not seem to work. I am not sure what is the problem. It does not seem to be doing anything.
I set it to ignore the collision of my player layer and the dynamic blocks but still they collide.

4
General Discussion / Re: Doodle Jump like smooth movement
« on: October 14, 2018, 04:33:49 AM »
Thank you djaydino, great ideas!
The set layer for the duration of the teleport sounds straightforward and the easiest to try for me right now but I'll try the set position also.
I have been moving the kinematic rigidbody2d character with set position before but then got afraid of that after reading here:

https://docs.unity3d.com/Manual/class-Rigidbody2D.html

"Kinematic Rigidbody 2D is designed to be repositioned explicitly via Rigidbody2D.MovePosition or Rigidbody2D.MoveRotation."

After this I switched to Rigidbody2D.MovePosition hoping that this way it will detect the platform Enter2DCollider more reliably and might never fall through a platform.
Which would be a disaster in such a game.

5
General Discussion / Re: Doodle Jump like smooth movement
« on: October 14, 2018, 12:58:57 AM »
Hi Thore,

Thank you very much!
Great ideas and lots of stuff to take in. I'll be occupied with those for a while.

I do have one question right away about using a rigidbody2d as the player and moving that around. I have that setup now (as the latest attempt to make it work) and the problem with it is when "teleporting" from one screen side to the other.

(In Doodle Jump the character can move out on one side of the screen and enter on the other side: teleporting from one edge of the screen to the other.)

The problem with this is that the RigidBody2dMovePosition
https://docs.unity3d.com/ScriptReference/Rigidbody2D.MovePosition.html
as it rapidly moves the character from one side to the other, it affects dynamic objects in the center of the screen.
If there is a tower made out of dynamic blocks, it will just instantly push any block hit, all the way to .... Siberia (...I guess, as they just disappear when the character is teleported across them)

This is the reason, I am thinking to go back to not using a rigidbody2d as the player, but fake everything: have the player character be just a regular object moved by it's transform, use raycasts to detect platforms.
Of course then I'll have problems with player interacting with dynamic physics objects: pushing them around.

I would appreciate any encouragement, insight on why to go one way and stick with that setup for such player character.

Thanks,
szomaza

6
General Discussion / Re: Doodle Jump like smooth movement
« on: October 13, 2018, 05:37:57 AM »
Also what about collision detection with platforms the player character jumps on?
It can NEVER happen that the character falls through a platform.

Is it good to rely on collision enter 2d events to detect falling on platforms or can/should it be more reliably faked?

I read something about 2d raycasts.
How does that work?
Do you have to cast a ray down from the character, then store that position and check until the character goes under it and then jump again?

Thanks,
szomaza


7
General Discussion / Doodle Jump like smooth movement
« on: October 13, 2018, 05:08:01 AM »
I am attempting to make something similar to Doodle Jump but the player character and camera movement is quite jittery.
I unfortunately have no idea how this should be done the best way.
Please share any thought or own experience I should try.

I have tried many different camera follow actions but none worked smoothly as in Doodle Jump.

The best so far I could do is move the player (kinematic rigidbody) with RigidBody2dMovePosition.
Setting it's position to an animated float curve value, simulating the jump height change.
And the camera is following this object.
Please see attached image for details of the current setup.

Thank you in advance for any ideas on how such a thing should be done to have it move smoothly.

br,
szomaza

8
Hi,

Just tried FighterCameraAdvance2d and in
2018.2.7f1
Playmaker: 1.9.0.p4

it says:

Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.FighterCameraAdvance2d.CalculateCameraPosAndSize () (at Assets/PlayMaker Custom Actions/Camera/FighterCameraAdvance2d.cs:271)
HutongGames.PlayMaker.Actions.FighterCameraAdvance2d.OnLateUpdate () (at Assets/PlayMaker Custom Actions/Camera/FighterCameraAdvance2d.cs:154)
HutongGames.PlayMaker.FsmState.OnLateUpdate () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:277)
HutongGames.PlayMaker.Fsm.LateUpdateState (HutongGames.PlayMaker.FsmState state) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2789)
HutongGames.PlayMaker.Fsm.LateUpdate () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2094)
PlayMakerLateUpdate.LateUpdate () (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerLateUpdate.cs:21)

edit:
the simpler: TargetsTrackingOrthoCamera action works.

Br,
szomaza

9
Playmaker Help / Re: Unity Ads 2.0 - Not working
« on: September 22, 2018, 02:43:55 AM »
Thank you GonerGames, that solved it.
I never thought I would have to update such Unity internal things separately after updating Unity.  :-)


10
Playmaker Help / Re: Unity Ads 2.0 - Not working
« on: September 20, 2018, 07:35:34 AM »
Ads work on Android but not on iOS.
Every time I press an add, this appears in the xCode console:
".... You are using download over http. Currently Unity adds NSAllowsArbitraryLoads to Info.plist to simplify transition, but it will be removed soon. Please consider updating to https."

There seems to be an explanation and solution here:
https://stackoverflow.com/questions/39296567/you-are-using-download-over-http-currently-unity-adds-nsallowsarbitraryloads-to

Do the Unity Ads actions need to be updated now?

Please help! Thanks!
szomaza

11
Solution:
I did what's recommended in the troubleshooting when you get errors after updating playmaker:
https://hutonggames.fogbugz.com/default.asp?W624

...
4. Delete the PlayMaker/ folder
5. Delete Plugins/PlayMaker/ folder if it exists
...

And after reinstalling Playmaker, these error are gone.
YAY!

12
Updating my project to

Unity 2018.2.7f1
Latest Playmaker in the asset store

and get the following errors.

I already "fixed" some others by deleting ProceduralMaterial folder, as suggested here:
http://hutonggames.com/playmakerforum/index.php?topic=18466.0
but can not find a solution for these:

Assets/PlayMaker/Actions/ComponentAction.cs(62,39): error CS0619: `UnityEngine.NetworkView' is obsolete: `The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.'

Assets/PlayMaker/Actions/CreateObject.cs(88,38): error CS0619: `UnityEngine.Network.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, int)' is obsolete: `The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.'

Assets/PlayMaker/Actions/CreateObject.cs(88,38): error CS0619: `UnityEngine.Network' is obsolete: `The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.'

Please help! Thanks in advance,
szomaza

13
Share New Actions / Re: DoTween Actions (DOTween v1.1.310)
« on: August 28, 2018, 08:45:17 AM »
I am trying this out and using the DotweenPathTransformTo
it works but the documentation says:http://dotween.demigiant.com/documentation.php
"Additional options are available via SetOptions and SetLookAt."

The SetLookAt stuff would be required to enable the look ahead feature.

Does anybody have an action for this?

Thanks in advance,
szomaza

edit: the paid actions package seems to have the look at feature:
https://youtu.be/8AhR_Tf6JME?list=PLszfX2HJpT-LmkicqdsQx415XS4A_4xfP&t=142

14
Playmaker Help / Re: Itween Move To_V2 Compil Error !
« on: August 28, 2018, 07:37:51 AM »
I just tried to use it and got the same error.
Any solution?

15
Playmaker Help / Re: Unity Ads 2.0 - Not working
« on: July 07, 2018, 11:00:21 AM »
It was Unity 2017.1.1f1 where it works on both platforms.

I'll create a project from scratch to test this on iOS and reply with results...

Of course, please comment if somebody gets it working or finds the problem.

Thanks,
szomaza

Pages: [1] 2 3 ... 13