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

Pages: [1]
1
Share New Actions / Smooth camera/object rotation
« on: January 16, 2014, 03:18:06 AM »
A rewrite of "MouseLook" to include smooth motion.

Does not use physics or itween - it just averages motions over a moving window.

It does not use clamping because I don't need it personally need it. The clamping implementations of this I have seen don't work that great and a complete solution is harder than it sounds at first.

I gave it a bash and then stopped when I realised how much fiddling it would be and that I don't even need it!  :P

Maybe a problem for another day or someone with more time on their hands than me.  :P



 

2
Official Action Updates / Re: Exploder Actions
« on: January 15, 2014, 02:48:36 PM »
Very cool. That has just gone on my wish list. :)

3
Official Action Updates / Re: Mouse look fix
« on: January 15, 2014, 02:44:03 PM »
I understand and agree with why it is there, just not with the particular implementation. (unity's fault in this case it appears)

Which is why I did exactly that in my code. :) The numbered list describing my ideal implementation is exactly what my code does. (well...I hope! ;) )

4
Official Action Updates / Mouse look fix
« on: January 14, 2014, 07:48:21 PM »
This started as a bug but then I found the source of it so I ended up fixing it myself. There is a related bug report but I figured posting it here also would be the right thing to do.

This is my first look into any playmaker code at all (I now have all of 10 mins experience with it!) so go easy on me.  ;D

The problem is that once you have used mouselook to rotate an object it will have its constraints frozen permanently.

It appears it was a piece of code that was only added because it was part of the unity code it was borrowed from. I think the code is necessary because there could be problems with other rotational effects causing the mouse control to appear buggy to the user. Exposing it as an option to the user to turn on and off is a good idea but only half the solution.

Code: [Select]
// Make the rigid body not change rotation
// TODO: Original Unity script had this. Expose as option?
if (go.rigidbody)
{
go.rigidbody.freezeRotation = true;
}

Two problems:

  • Firstly it destroys user data as an artifact which is never good as a best practice. What if I set the freezing params in a certain way for a particular purpose?
  • The second is that it leaves behind a residual and potentially unwanted after effect - that of a frozen object.

I would suggest that what should happen is:

  • Rotation params are saved on entry
  • Params are frozen if the users requires it (default:on)
  • In all cases the rotation params are set back to the way they were before

Rather than just hand this over and expect someone else to do all the work I decided to have a crack at doing this myself. :)

Because the playmaker framework is so elegant it was trivial. (assuming I got it right)

I have attached my attempt at this code. :) I hope this is correct.

5
Playmaker Bug Reporting / Re: FSM changes reverting after play
« on: January 06, 2014, 03:52:05 PM »
Same here.

It is definitely to do with lock being on. I can toggle the bug easily just by clicking lock on and off.
Even if I switch to another state and back it is the same thing.

Pages: [1]