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

Pages: [1] 2 3 ... 9
1
Playmaker Help / Re: [Solved] Projectiles are deflecting off of targets
« on: January 26, 2019, 09:51:14 AM »
Hi djaydino,

Yeah it happened in builds too.

2
Playmaker Help / Re: Projectiles are deflecting off of targets
« on: January 25, 2019, 07:47:36 PM »
Hi GonerGames,

I tried your test script and modified it to fix my game. I can’t believe it worked to be honest. I will have to look at the playmaker action for collision enter 2d and see what the differences are. That must mean there is some conflict between playmaker and unity of some type or the information isn’t being passed to playmaker like you said. But thanks for the help!

3
Playmaker Help / Re: Projectiles are deflecting off of targets
« on: January 24, 2019, 02:19:22 PM »
Hi GonerGames,

I tried the suggested values but the projectile still deflected in the same manner. I had thought about the Timestep but hadn't tried it yet, it was a good idea though.

4
Playmaker Help / Re: Projectiles are deflecting off of targets
« on: January 23, 2019, 10:55:10 PM »
Hi djaydino,

I use the physics system to move my projectiles with add force2d so unfortunately that's not an option.

5
Playmaker Help / Re: Projectiles are deflecting off of targets
« on: January 23, 2019, 10:09:03 AM »
Hi Jean,

I checked the log before and after the deflection and it is empty. Also my collider event2d never got called on the state it was on. I think it has something to do with minimum penetration of the collision. I tried changing the "default contact offset" in the project settings on the 2d physics but it still happens a bit.

If there isn't a fix for this, is there a better way to do these projectiles and still get the collision information?

6
Playmaker Help / [Solved] Projectiles are deflecting off of targets
« on: January 22, 2019, 11:19:55 PM »
Hi,

I think this is more of a unity question but I figured I would ask here since I am using Playmaker. I have an FSM on my projectile that listens for the collisions. Most of the time this works fine. Although if the projectile hits a target at the right angle it will deflect and just either float there or hit something else and despawn. I have all my tags and layers set up correctly but sometimes a projectile will deflect and most times it works. My game is a 2d twin stick shooter.

Note* it is rare when playing that this happens but I can reproduce it by position my player in just the right spot. I have attached and image of the problem. In the image this time one of the enemies fired a projectile and it deflected off of my player.

I shoot a lot of projectiles in my game at one time as well so I'm not sure raycasting is the way to go. I also can't use triggers (i dont think) because I need to use "get collision2d info" to spawn particles and use it for knockback calculations.

Thanks for any advice.

7
Playmaker Help / Re: Copying Array from script to FSM Array.
« on: January 16, 2019, 05:05:16 PM »
Hey djaydino,

I finally got it to work. Thanks for your help. Apparently I am not able to assign the array value on start and I had to use the full line where I was saving them:

Code: [Select]
DoorFunctionalityFSM.FsmVariables.GetFsmArray(nameOfArrayToWorkWith).SaveValues();

8
Playmaker Help / Re: Copying Array from script to FSM Array.
« on: January 16, 2019, 12:57:44 PM »
Hello djaydino,

I tried adding your suggestion to my code but I am get this error:

Code: [Select]
Nested arrays are not supported yet!
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.FsmArray:Load(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmVariables/FsmArray.cs:251)
HutongGames.PlayMaker.FsmArray:SaveChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmVariables/FsmArray.cs:339)
GetDoorPrefabsInTile:FindDoorPrefabs() (at Assets/_GameAssets/Scripts/GetDoorPrefabsInTile.cs:44)
System.Reflection.MethodBase:Invoke(Object, Object[])
HutongGames.PlayMaker.Actions.CallMethod:DoMethodCall() (at Assets/PlayMaker/Actions/ScriptControl/CallMethod.cs:98)
HutongGames.PlayMaker.Actions.CallMethod:OnEnter() (at Assets/PlayMaker/Actions/ScriptControl/CallMethod.cs:64)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2768)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2715)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
HutongGames.PlayMaker.Fsm:Start() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1926)
PlayMakerFSM:Start() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:548)


Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DunGen;
using HutongGames.PlayMaker;

public class GetDoorPrefabsInTile : MonoBehaviour
{
    public FsmArray pfsmArray;
    public PlayMakerFSM DoorFunctionalityFSM;
    public string nameOfArrayToWorkWith;
    public Tile tile;
    private GameObject[] PlaymakerFSMArray;

    private void Start()
    {
        pfsmArray = DoorFunctionalityFSM.FsmVariables.GetFsmArray(nameOfArrayToWorkWith);
    }

    public void FindDoorPrefabs()
    {
        GameObject[] tempArray;
        int doorIndex = 0;

        int Doorwaycount = tile.Placement.UsedDoorways.Count;

        tempArray = new GameObject[Doorwaycount];
        // Loop through each used doorway in the tile - used doorways are those that are connected to other tiles
        foreach (var doorway in tile.Placement.UsedDoorways)
        {
            // Only one door prefab is spawed per doorway-pair so it might be on this doorway, or it might be on the other
            GameObject doorPrefab = (doorway.UsedDoorPrefab != null) ? doorway.UsedDoorPrefab : doorway.ConnectedDoorway.UsedDoorPrefab;

            if (doorway.UsedDoorPrefab != null)
            {
                tempArray[doorIndex] = doorPrefab;
                doorIndex++;
            }

        }
        //doorIndex = 0;
        pfsmArray.Values = tempArray;
        pfsmArray.SaveChanges();
    }

}

9
Playmaker Help / [Solved]Copying Array from script to FSM Array.
« on: January 16, 2019, 02:15:26 AM »
Hi community,

I am trying to write a bridge of sorts between Dungen and Playmaker assets.

I am trying to copy the array values from my script to the fsm array variable so I can work with it in playmaker. For some reason I can't figure out why the array values wont load into the playmaker fsm I have assigned in the inspector. Any help would be appreciated, Thanks!

Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DunGen;
using HutongGames.PlayMaker;

public class GetDoorPrefabsInTile : MonoBehaviour
{
    public FsmArray pfsmArray;
    public PlayMakerFSM DoorFunctionalityFSM;
    public string nameOfArrayToWorkWith;
    public Tile tile;
    private GameObject[] PlaymakerFSMArray;

    private void Start()
    {
        pfsmArray = DoorFunctionalityFSM.FsmVariables.GetFsmArray(nameOfArrayToWorkWith);
    }

    public void FindDoorPrefabs()
    {
        // Get the tile that you want somehow
        GameObject[] tempArray;
        int doorIndex = 0;

        int Doorwaycount = tile.Placement.AllDoorways.Count;
       
        tempArray = new GameObject[Doorwaycount];
        // Loop through each used doorway in the tile - used doorways are those that are connected to other tiles
        foreach (var doorway in tile.Placement.UsedDoorways)
        {
            // Only one door prefab is spawed per doorway-pair so it might be on this doorway, or it might be on the other
            GameObject doorPrefab = (doorway.UsedDoorPrefab != null) ? doorway.UsedDoorPrefab : doorway.ConnectedDoorway.UsedDoorPrefab;

            if (doorway.UsedDoorPrefab != null)
            {
                tempArray[doorIndex] = doorPrefab;
                doorIndex++;
            }
           
        }
        //doorIndex = 0;
        pfsmArray.Values = tempArray;
    }

}

10
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 14, 2019, 10:24:17 AM »
Hi Jean,

I eventually had to give up on the action and did it like it is pictured in my image below, it works for me even though I am not getting the closest enemy in the array. I am not sure why its not working, as far as I know my 2D collision matrix is fine. Also there isn't even any collision boxes in between the AI and the enemy. Thank you for taking the time to help me though I really appreciate it!

11
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 13, 2019, 11:52:50 PM »
Hey Jean,

It works for me in a fresh scene but in my current game scene it must be blocked by something, which is why I was wondering if there was some way of testing what the ray/linecast is hitting. I also turned off “queries hit triggers” too and it still doesn’t work in my game scene. And yeah I do have 2d colliders and checked 2d physics.

12
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 11, 2019, 04:38:27 PM »
Thanks Jean, I am having a problem though. I can't get the "closest Gameobject"'s value. It is always "none". With or without layermasks. I tried to use a debug.log but it didn't show up in the console either. Is there anyway to see what the linecast is hitting?

13
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 10, 2019, 10:31:24 AM »
Awesome! Thanks Jean!

14
Playmaker Help / Re: Unity 2018.3 / Assertion Failed go.TestHideFlag
« on: January 05, 2019, 11:12:32 PM »
I had this problem too. My builds were failing until I deleted the “add component” playmaker action. After that sometimes I got these errors when building and sometimes I didn’t but all my build work even with these errors now.

15
Action Requests / Array get closest game object in sight (2D)
« on: December 31, 2018, 07:34:15 PM »
I decided to make a separate thread on this topic. I tried this action from the ecosystem but I soon figured out that the line cast is done in 3d physics and I need it for 2d. I tried to modify the script to work with 2D but I was unsuccessful. The documentation on the line cast doesn’t use “out” so I am unsure what to do.

Thanks!

Pages: [1] 2 3 ... 9