playMaker

Author Topic: Trigger actions on Smooth Look rotations above a certain threshold?  (Read 1192 times)

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
Maybe someone can help me with this - it feels like there should be a fairly simple way to achieve this, and I'm just missing something obvious.

I am working on a twin stick shooter, and I have added a "sword" weapon type to it. The idea is that the player can wave it around by aiming with the right control stick. This turned out to be surprisingly simple to achieve, as you can see on the attachment.

Ideally though, I'd like the sword to leave a glowy trail behind it when it's moved "quickly" - so that it leaves a slash when the player makes strong changes in it's motion.

I figured this would be trivial, just do some simple maths each frame to see if the difference between "FiringDirection" and the swords current orientation was above some threshold, and if it was, enable the trail.

The problem I'm having is that I just can't seem to find any way to get the swords current orientation as a vector. I can grab it's current rotation, but can't figure out how to convert that into a vector that I can compare with "FiringDirection".

Is there any way to find out how far the sword is going to move, or failing that, a way of converting the FiringDirection vector3 into a rotation? Anyone ever done anything like this and have a better way?

Help much appreciated :)

« Last Edit: November 13, 2015, 02:42:56 PM by ManicMinerUK »