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

Pages: 1 2 [3] 4 5 ... 37
31
Share New Actions / Sharing 49 of my custom actions
« on: January 27, 2017, 01:07:27 PM »
Since snipt.net went down my custom actions went offline- I added most all of them to github + some new ones here with images and descriptions https://github.com/mdotstrange/MdotsCustomPlaymakerActions

I hope they are useful to someone  :) None of them use any third party scripts and all the array actions use Playmaker native arrays.

32
Share New Actions / Re: Play Random Audio From Array
« on: January 25, 2017, 06:28:14 PM »

33
Playmaker Help / Re: Play Sound Workaround Questions...
« on: January 24, 2017, 09:31:51 AM »
No problem Heath  :)

I've really come to love coding even though I'm just a beginner- I've made a ton of Playmaker actions recently- I'll put them online/organize/share them soon as I'm sure some of them would be useful to others.


34
Playmaker Help / Re: Play Sound Workaround Questions...
« on: January 23, 2017, 07:55:24 PM »
I attached two actions that I made that might be useful- one plays a random sound from an array and also randomizes the pitch- and another that randomizes the pitch on a single sound-

35
Playmaker Help / Re: Inpspector Lag with large FSMs
« on: January 20, 2017, 01:22:28 AM »
Here's one I did on Playmaker arrays- I go over loops in it https://www.youtube.com/watch?v=yOZK8yr3IKo

36
Playmaker Help / Re: Inpspector Lag with large FSMs
« on: January 17, 2017, 09:33:37 PM »
I've got some Fsm's in my current project with probably close to a hundred states in them- I've gotten used to a small loss in UI responsiveness when working with them- don't know if thats the slowdown you are referring too-

I try to avoid fsm's with tons of states now- instead I break them into a number of smaller fsm's that interact with each other using the Get/Set Fsm variable actions- and I try to use loops as much as possible when doing repetitive things- "array/Arraylist get next" actions-

Also I've noticed with Playmaker and other assets with their own interfaces that if you have the interface active when in play mode it slows everything down- so I make sure to deselect the fsm objects when in playmode- and only make the fsm visible/active when debugging-

37
Share New Actions / Ootii Camera Controller actions
« on: January 17, 2017, 12:19:40 PM »
These are actions for the excellent Camera Controller asset- if you need a good camera controller then give it a look https://www.assetstore.unity3d.com/en/#!/content/13768

Here's the actions https://github.com/mdotstrange/CameraControllerPlaymakerActions

38
Playmaker Help / Re: Get vector towards another object?
« on: January 16, 2017, 12:41:08 AM »
Subtract one Vector3 from another to get the direction- can use the Vector3 Operator for that then use Vector3Normalize on the direction- then apply the direction as a force etc to move objects towards/away from others-

Can multiply the direction by a float to reverse it/make it stronger/weaker

39
Playmaker Help / Re: Inpspector Lag with large FSMs
« on: January 14, 2017, 11:17:43 PM »
Try unchecking "Auto refresh action usage"

40
Share New Actions / Npc Knockback action
« on: January 14, 2017, 10:17:21 PM »

This action is meant to be used on an Npc to knock it back when its damaged/hit- it works with Npc's that use NavmeshAgent, RigidBody, or CharacterControllers for movement. Just choose the one you want in the popup. It will knock the Npc back in the direction of what it was hit by.

On your projectile or melee weapon- use a cast(raycast, spherecast, etc)- get the hitpoint from the cast and pass it to this action through the "HitPoint" var and the action will do the rest.

Code: [Select]
// by MDS
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
    [ActionCategory(ActionCategory.Physics)]
    [Tooltip("Applies knock to a game object using a Rigidbody, NavmeshAgent or Character Controller")]
    public class KnockbackAction : FsmStateAction
    {
        [RequiredField]
        [Tooltip("The object to knockback")]
        public FsmOwnerDefault knockThisBack;
        [Tooltip("Select type- selected component must be present on object or it won't work")]
        public enum objectType {NavMeshAgent,RigidBody,CharacterController }
        public objectType type;
        private Vector3 npcPos;
        [Tooltip("The hitPoint from a cast")]
        public FsmVector3 hitPoint;
        [Tooltip("How far to knock the object back")]
        public FsmFloat knockBackAmount;
        Rigidbody rb;
        NavMeshAgent nav;
        CharacterController cc;

        public bool everyFrame;

        public override void Reset()
        {
            everyFrame = false;
        }

        public override void OnEnter()
        {


            DoKnockBackAction();

            if (!everyFrame)
            {
                Finish();
            }
        }

        public override void OnUpdate()
        {
            DoKnockBackAction();
        }

        void DoKnockBackAction()
        {
            var go = Fsm.GetOwnerDefaultTarget(knockThisBack);
            if (go == null)
            {
                return;
            }

            int eValue = (int)type;

            switch(eValue)
            {
                case 0:
                    // navmesh
                    nav = go.GetComponent<NavMeshAgent>();
                    npcPos = go.transform.position;
                    Vector3 direction1 = (npcPos - hitPoint.Value).normalized;
                    direction1 = direction1 * knockBackAmount.Value / 2;
                    direction1 = new Vector3(direction1.x, 0f, direction1.z);
                    nav.Move(direction1);
                   

                    break;
                case 1:
                    // rb
                    rb = go.GetComponent<Rigidbody>();
                    npcPos = go.transform.position;
                    Vector3 direction = (npcPos - hitPoint.Value).normalized;
                    direction = direction * knockBackAmount.Value;
                    direction = new Vector3(direction.x, 0f, direction.z);
                    rb.AddForce(direction, ForceMode.VelocityChange);

                    break;
                case 2:
                    // cc
                    cc = go.GetComponent<CharacterController>();
                    npcPos = go.transform.position;
                    Vector3 direction2 = (npcPos - hitPoint.Value).normalized;
                    direction2 = direction2 * knockBackAmount.Value * 10f;
                    direction2 = new Vector3(direction2.x, 0f, direction2.z);
                    cc.Move(direction2 * Time.deltaTime);

                    break;

            }

           


         


        }


    }
}


41
Playmaker Help / Re: How to create gears for a boat with Playmaker ?
« on: January 07, 2017, 05:48:18 PM »
Sounds like you need a multiplier-

So for setting your speed float- whenever you set it- multiply it by another float that will act as a multiplier- then you just change the multiplier to set the different speeds- you can change the multiplier float from within that FSM or outside of it as well.

42
Playmaker Help / Re: Particle Collision
« on: January 03, 2017, 01:45:01 PM »
Attached the script since snipt is no longer.

43
Playmaker Help / Re: Run State If only
« on: January 02, 2017, 12:49:41 PM »
Try the "Game Object Compare" action

44
Those are the native Playmaker array actions- if you want to use Arraymaker arrays then use the actions from the Arraylist category like in this image


With arraymaker you can't choose the array name from a list- you have to type/copy paste the name in the "reference" field

If you want to use the native arrays- you must first create an array variable-then you can choose it with a popup

45
By "clip" do you mean they go through the geometry?

For jumping- since you are using simple move that means you're using a character controller- there are actions for the character controller that check if its grounded- so before you allow the character to jump check to make sure its grounded first-

You can also add a trigger collider to the feet and make sure that is hitting the ground using TriggerEnter and/or Trigger stay-

You can also fire a ray/spherecast towards the ground from the characters hips and only allow jumps when it hits the ground-

So whatever technique you use you want to add a bool test before jumping to see if the character is grounded-

I've been working on an action 3d platformer for some time now and yes, its quite a challenge!

Pages: 1 2 [3] 4 5 ... 37