Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: cmvrgr on June 24, 2013, 10:37:13 PM

Title: boat bobbing and controls ? any hint on how to do it?
Post by: cmvrgr on June 24, 2013, 10:37:13 PM
I am trying how to make a fake bobbing of a boat and how to control it.
Any help will be appreciated  :D :D :D

Best Regards
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: escpodgames on June 25, 2013, 01:09:43 AM
There are so many ways to do it but that would depend on what type of bobbing and how you want to control it .... any more info?

I'd assume you want an up and down motion based on a wave height and a (for lack of a better word) wave spacing.

This is just how I would do it ...

Set the position of the boat, based on a curve (sample curve action) and then alter the curve output based on the height of the wave, the spacing would come from the time/speed to sample along the curve.
This will only give you vertical movement .. if you wanted anything more you may have to look at a different solution.
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: jeanfabre on June 25, 2013, 01:54:28 AM
Hi,

 For faking floating boat, you could use a noise generator:

http://hutonggames.com/playmakerforum/index.php?topic=46.msg199#msg199

bye,

 Jean
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: cmvrgr on June 25, 2013, 10:01:28 AM
Is it possible from someone to upload a demo of the bobbing ?
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: jeanfabre on June 26, 2013, 06:23:45 AM
Hi,

 Here we go :)

bye,

 Jean
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: cmvrgr on June 26, 2013, 12:16:31 PM
I would like to thank you for the demo but I am facing some problems.

When I run it it give the below errors:

Could Not Create Action: Boat model: Up float: up float: PerlinNoise (Maybe the script was removed?)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Init(MonoBehaviour)

and


Could Not Create Action: Boat model: FSM: State 1: PerlinNoise (Maybe the script was removed?)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Init(MonoBehaviour)
PlayMakerFSM:Init()
PlayMakerFSM:Awake()


do you know why that is happening ?

Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: jeanfabre on June 26, 2013, 02:03:50 PM
Hi,

 I simpyl attached the wrong file, I should have attached a package instead. Please redownload it.

 Bye,

 Jean
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: cmvrgr on June 26, 2013, 05:41:15 PM
Thanks for your help but i am facing a new one. The boat after I press play on unity  it disappears and is moved away from its original point. Why is that happening ;
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: jeanfabre on June 27, 2013, 12:58:57 AM
Hi,

 I guess you have changed the noise values and multiplier right?

 basically, the noise goes between 0 and 1, so if you want the boat to move between -10 and 10 units, you need to multiply the noise by 10 AND substract 5 to it, then you can inject that value in the transform position and it will evolve around it's center.

yes?

bye,

 Jean
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: cmvrgr on June 27, 2013, 11:45:22 AM
Thank you Jean about your help.

I actually used various t Buoyancy  scripts and now by boat floats over the water.

The problem that i am facing now is that playmaker (I have updated to the latest version) is not working.

I will explain it with a paradigm that I used.

I created a sphere object as a switch and I used mouse down script  to activate and deactivate lights.

When the object is out of the gameobject of boat playmaker is working. When I attach it as a child (i am doing that because i need to bobb the switch with the whole boat) is not working.

Μy boat it has a rigitbody component and the scripts (I tried various scripts with the same effect) for Buoyancy over the water.

I also email it to a friend that had the Buoyancy toolkit and reacts the same to him too.

Αny ideas ?
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: jeanfabre on June 27, 2013, 02:01:26 PM
Hi,

 I am not sure what you actually mean by "Not working". How does that fails to work? do you get errors in the console? do you get states stuck and bot following the logic you expect? do you seem to get wrong values? PlayMaker "not working" can be really about anything, so if you can give a concrete example ( pm me, don't hesitate, I'll have a look) or a video showing what's going wrong, that would help finding the root of the issue.

bye,

 Jean
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: cmvrgr on June 27, 2013, 06:24:34 PM
I asked my friend to record a video

I just messaged you the download link.

I would like to thank you for your support
Title: Re: boat bobbing and controls ? any hint on how to do it?
Post by: cmvrgr on June 28, 2013, 07:08:02 PM
It is working only if you apply a ridgit body tag  ;D