playMaker

Author Topic: SuperSpines Actions!  (Read 4990 times)

Groo Gadgets

  • Beta Group
  • Full Member
  • *
  • Posts: 175
SuperSpines Actions!
« on: May 10, 2013, 05:43:21 AM »
Hey guys,

I'm using the awesome plugin SuperSplines in my game and have it playing well simply by using "get property" and "set property" actions.

The specific function I need requires some coding and I would love to see it as a PlayMaker action. I am creating a 2.5D platformer and I would like it "on the rails" using a spline that conforms the player to the spline path while retaining full rigid body collisions.

A perfect example of exactly what i'm trying to do can be seen in this trailer for the game ScaryGirl: http://www.youtube.com/watch?v=uAaYwU4M5Kg

Speaking with the developer, he suggested a way I can get a solution working:
Quote
I would recomment you to approach the situation as follows: Start with a rigidbody that is set to "kinematic" or better yet with a CharacterController component. Now if you want to constrain its position to the spline's local x-axis, simply calculate the spline's closet point to your Character using the GetClosestPointParam( ) and GetPositionOnSpline( ).

Now simply set the result's y value to your character's current y value and you will get the position of the character constrained to the spline. Now you just have to move the character to this position using CharacterController.Move( ) or Rigidbody.position = newPosition.

In order to move the character along the spline you can use the normalized tangent of the spline as direction for the velocity. You could add the velocity to your CharacterController by using CharacterController.Move( spline.GetTangentToSpline( GetClosestPointParam( playersPosition ) ).normalized * targetVelocity );

It would be great if someone could help me integrate this as an action or if anyone has a solution that works as well or better using iTween paths or equivalent I would be most grateful! I'm prepared to pay cash to get this up and running as soon as possible!

Thanks,

Simon

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: SuperSpines Actions!
« Reply #1 on: May 11, 2013, 10:22:55 AM »
Hi,

 I have a modified iTween path action to do that:

http://hutonggames.com/playmakerforum/index.php?topic=1699.0

Else, a proper set of custom action for SuperSpline would be needed. Pm me if you need these actions to be created ( basically, I would need to purchase it, as I don't own it, if I was to make actions for it)

bye,

 Jean

Groo Gadgets

  • Beta Group
  • Full Member
  • *
  • Posts: 175
Re: SuperSpines Actions!
« Reply #2 on: May 16, 2013, 05:12:05 AM »
Hey Jean,

I've had a play with your iTween path action and I can't see how it be used the way I have described in my previous post. Could you please give me a quick rundown on how I would go about achieving this effect?

Cheers,

Simon

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: SuperSpines Actions!
« Reply #3 on: May 16, 2013, 03:10:04 PM »
Hi

I am not sure of the actual effect you want to achieve now. on the video I don't see any character following a path it seems.

 Basically, If you use a gameObject that has a collider and animate it on a path with itween it will interact with other rigidbodies. I double checked and it works fine.

 typically, you can take the playmake test lab example, "MoveTo_Path" in TestLab samples. The cylinder which is a Character is animated using itween path. if I put rigid bodies around the scene, the cylinder will collide and knock them out.

 is that what you want to achieve? else can you describe a bit more?

bye,

 Jean

Groo Gadgets

  • Beta Group
  • Full Member
  • *
  • Posts: 175
Re: SuperSpines Actions!
« Reply #4 on: May 27, 2013, 03:10:51 AM »
Hey Jean,

Can you please supply a link to the example you mentioned? I've done a Google search and I can't find it :-(

Cheers,

Simon

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: SuperSpines Actions!
« Reply #5 on: May 28, 2013, 02:03:21 AM »
Hi,

 it's the playmaker samples, you can get them here:

http://www.hutonggames.com/samples.php

get the "Download PlayMaker Sample Scenes" in there, after you unpacked it in Unity, you will have the scene "MoveTo_Path".

bye,

 Jean