playMaker

Author Topic: boat bobbing and controls ? any hint on how to do it?  (Read 3212 times)

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
boat bobbing and controls ? any hint on how to do it?
« on: June 24, 2013, 07: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

escpodgames

  • Hero Member
  • *****
  • Posts: 673
    • View Profile
    • Assets
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #1 on: June 24, 2013, 10:09:43 PM »
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.
« Last Edit: June 24, 2013, 10:17:01 PM by LampRabbit »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #2 on: June 24, 2013, 10:54:28 PM »
Hi,

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

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

bye,

 Jean

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #3 on: June 25, 2013, 07:01:28 AM »
Is it possible from someone to upload a demo of the bobbing ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #4 on: June 26, 2013, 03:23:45 AM »
Hi,

 Here we go :)

bye,

 Jean
« Last Edit: June 26, 2013, 11:03:01 AM by jeanfabre »

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #5 on: June 26, 2013, 09:16:31 AM »
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 ?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #6 on: June 26, 2013, 11:03:50 AM »
Hi,

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

 Bye,

 Jean

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #7 on: June 26, 2013, 02: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 ;

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #8 on: June 26, 2013, 09:58:57 PM »
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

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #9 on: June 27, 2013, 08: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 ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #10 on: June 27, 2013, 11:01:26 AM »
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

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #11 on: June 27, 2013, 03: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
« Last Edit: June 27, 2013, 03:32:29 PM by cmvrgr »

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Re: boat bobbing and controls ? any hint on how to do it?
« Reply #12 on: June 28, 2013, 04:08:02 PM »
It is working only if you apply a ridgit body tag  ;D
« Last Edit: June 29, 2013, 07:03:08 AM by cmvrgr »