playMaker

Author Topic: Move object clone to tapped location[Solved]  (Read 2568 times)

Rayray45446

  • Playmaker Newbie
  • *
  • Posts: 6
Move object clone to tapped location[Solved]
« on: November 07, 2017, 10:03:04 PM »
Hi everyone, I'm trying to set up chip buttons when pressed a clone of the object will move towards the tapped location. Simulating placing a clone of the object where tapped on mobile phones. I've tried creating a game object storing the position of the original object and moving from that positon towards stored tapped location. It doesn't operate as wanted.  Any help on what I'm doing wrong is greatly appreciated.
« Last Edit: November 20, 2017, 09:23:33 PM by Rayray45446 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Move object clone to tapped location
« Reply #1 on: November 08, 2017, 03:31:26 AM »
Hi,
You probably need to convert you tapped location with the "Screen To World Point" action.

If that does not work, can you give some more information (images/videos from your fsms/states/actions) on your setup?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Move object clone to tapped location
« Reply #2 on: November 08, 2017, 03:51:30 AM »
Hi,

 use ScreenTo3dPlanePoint from the Ecosystem to get total control of a screen position placement inside a 3d world.

 Bye,

 Jean

Rayray45446

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Move object clone to tapped location
« Reply #3 on: November 08, 2017, 04:42:13 PM »
Hi,
I installed the ScreenTo3dPlanePoint and got 8 compiler errors about the camera being deprecated. I've tried looking online for solutions but didn't find any that made sense to me. I am a newbie when it comes to coding. Any help on how to fix these is errors is greatly appreciated.

Rayray45446

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Move object clone to tapped location
« Reply #4 on: November 08, 2017, 06:13:49 PM »
I've uploaded a couple pictures of the fsm. In the ChipsMover fsm I find game object by tag which are set are by tapping on the chips. Store it in a global variable. Next user can tap on bet square to place bet. That position is stored as a vector 3 variable in pick location state using screen to world point. Then using TweenMoveTo game object with tag should move to that position. I don't know what I'm doing wrong for it to not work properly.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Move object clone to tapped location
« Reply #5 on: November 09, 2017, 01:00:48 AM »
Hi,

 Please take screenshots directly qith your computer, quality will be better, here it's too blurred :)

 in your case, you don't want the user to be able to click anywhere, you need to have colliders setup for each spot the user can click on, and each spot must have a unique ID or an Fsm that knows what this spot is meant to do and what it means for the game.

what I can provide as a sample would be several spots, one where you chave chips, and several placeholders where the user can place them and as you pick a coin and click a spot the coin would animate to that place.

 would that work for you. the idea to be able to click anywhere is not going to work for you, but I can make a sample to do so as well if you want.

as for the action giving errors, it's likely because you haven't let Unity update the api, you should have got a Unity warning telling you to do so, but I'll update that action so that it's not necessary.

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Move object clone to tapped location
« Reply #6 on: November 09, 2017, 01:10:03 AM »
Hi,

 that's what Unity should tell you when you download this action:



did you get that?

 Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Move object clone to tapped location
« Reply #7 on: November 09, 2017, 03:47:51 AM »
Hi,
On windows, search for snipping Tool its very useful if you want to make an image from a part of your screen, then it upload to imgur,
if you have an account you can just highlight imgur webpage and press ctrl+v (after using sniping tool) without saving the Snip
then get the direct link and use the insert image (just below the big B top left)
place your link in between.

@Jean When i downloaded the action i did also get these errors on 1 project but after restarting it did some updating and then it worked, but i did not that message.
And i just tried on a 2nd project (just updated from 2017.1 to 2017.2 to and then i did not get any errors when adding the action.

Rayray45446

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Move object clone to tapped location
« Reply #8 on: November 09, 2017, 06:11:34 AM »
Thanks for the tips on providing better screen shots jean and djaydino.
@jean I've set up trigger for the chips place holder and got it to work as wanted. I just need to figure out how to make it repeatable each time a chip is pressed.

Also when I first downloaded the action I did not receive a API update from unity. I'm still on unity 2017.1

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Move object clone to tapped location
« Reply #9 on: November 09, 2017, 06:15:39 AM »
Hi,
2017.1 is buggy i would suggest to update to 2017.2

Be sure to make a backup 1st just to be sure, but there should be no issues.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Move object clone to tapped location
« Reply #10 on: November 10, 2017, 01:14:43 AM »
Hi,

 the api update is not a bug, it's a feature :) it will happen in 2017.2 as well, PlayMaker covering so much ground from Unity 4 to 2017 means some api has to be updated and Unity is aware of this and runs this checker and automatically change code where it's obvious. So it's fine.

 bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Move object clone to tapped location
« Reply #11 on: November 10, 2017, 04:49:35 AM »
Hi,
Actually i was not referring to the api update, but some other bugs sorry for the misunderstanding :)