playMaker

Author Topic: Mirror Float Ranges  (Read 1763 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Mirror Float Ranges
« on: January 15, 2014, 01:56:46 PM »
Hi all. Been looking into this for a while without much success so I'll just ask here in case someone knows:

I'm trying to create a type of object that pushes the player away in the Z direction that object is facing. That part is done with an AddForce and Transform Direction where I have the local direction Vector3 with the desired force value on the Z of that Vector3. I then store the result of the Transform Direction and use that vector on the AddForce.

Here's the issue: I want the force to increase the closer the player is to that object.
I thought of doing it with a Get Distance action, store the that result, use a Float Clamp action to set min and max values.
So far so good. But now I wanted that distance range to be translated to the AddForce Vector3.

So for instance - if the distance values were 0min and 200max, I'd want the Vector3 to go from 0,0,200 to 0,0,0 to mirror the distance in realtime. So if the player triggered that force 100 units away from the object it would be pushed by a force of 100.

Is there a way of doing this with playmaker?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Mirror Float Ranges
« Reply #1 on: January 15, 2014, 02:57:32 PM »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: Mirror Float Ranges
« Reply #2 on: January 15, 2014, 04:47:20 PM »
Hmm, sounds like a great action but I don't think it would work. The 0-200 values I gave were just as an example. I would need to tweak both the distance and AddForce values independently to tune the game play and so they can't be locked to mirror opposites.

Also that action deals exclusively with floats. The distance output is a float but, as far as I understand it, in order for the force to be in the Z direction of the emitter it needs to be in the Z of a Vector3. So the range operation would have to be between a float and the Z of a vector3... yea, sounds kinda nuts.   :-\