playMaker

Author Topic: [solved]slider/gameobject should affect (move) another gameobject  (Read 1707 times)

peaks

  • Playmaker Newbie
  • *
  • Posts: 27
Hey everyone!

I'm trying to create a custom 3D-slider which should affect another gameobject on one of its axis.

Right now I'm using the Easy Touch 5 asset to drag a cube (while mouseclick) on its x-axis. The cube can "move" to the left and to the right and I'm limiting his drag distance on the x-axis with Float Compare. (like in the playmaker breakout example).

x-axis values: -5<--------0-----[cube]-->+5

now the tricky part:
I want to control another gameobject with that "3D-slider". Lets say I move the cube to the right, my other gameobject should also begin to move f.ex. to the right (on its x-axis) and on its own limitied "track". something like this:

x-axis values: -5<--------0-----[cube]-->+5

x-axis values: -30<-------------------0----------[object2]--------->+30

I have no clue how to achieve this, could you guys help me out? It should be something like this example using min/max values, but unfortuantly I'm not using ui sliders :/ (
« Last Edit: January 22, 2017, 06:45:27 AM by peaks »

peaks

  • Playmaker Newbie
  • *
  • Posts: 27
Re: slider/gameobject should affect (move) another gameobject
« Reply #1 on: January 19, 2017, 12:08:20 PM »
anyone?  :'(

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: slider/gameobject should affect (move) another gameobject
« Reply #2 on: January 20, 2017, 01:40:36 AM »
Hi,
instead of float compare you might wanna use float clamp.

for the tricky part,
There are different ways to achieve this.
One way you could try is to :

Get the position from the cube and  multiply it.
In your sample it would be 'x6' if in your game the values are different, play around with the multiply value to get the wanted result.
Then set that position to the object 2.

peaks

  • Playmaker Newbie
  • *
  • Posts: 27
Re: slider/gameobject should affect (move) another gameobject
« Reply #3 on: January 22, 2017, 06:45:07 AM »
thanks man! It's working now :)