playMaker

Author Topic: DragAndShoot, how to do this like rageCube?  (Read 6501 times)

dbsrb43

  • Guest
DragAndShoot, how to do this like rageCube?
« on: November 08, 2012, 08:27:50 AM »
I really need this to happen for my game.
Please someone help me I'm new to coding.
Does anybody know a plugin for doing this?? on the asset store?
I can do everything else but how the character reacts to mouse or touch.
If this isn't a hard thing to do can someone please make the character for me??
For those of u who own playmaker, Can i do this in playmaker?/ :-X :-\
http://juhakiili.com/ragecube/
« Last Edit: November 13, 2012, 06:24:25 AM by jeanfabre »

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: Can someone have a easy way of accomplishing this??
« Reply #1 on: November 08, 2012, 12:07:28 PM »
There is no inherent way to make this with just playmaker, and coding the stretching behavior is some serious business and would require you to work with UVs and vertices. I've done it that way a couple of times, but now I'd definitely recommend a framework like megaFiers.
All in all it would probably be best for you to just abandon this thing for half a year or so, until you're more efficient with playmaker and programming in general. In all honesty, this is probably too hard if  you're new to it. If you want to do it with just playmaker you would have to write a bunch of actions yourself too.

Best,
kiriri
Best,
Sven

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Can someone have a easy way of accomplishing this??
« Reply #2 on: November 08, 2012, 01:29:32 PM »
Hi

Ok, not saying it's the easiest game to build, but really, this is all very simple from a technical point of view.

-- RageSpline is available on the asset store, so modifying the cube visually like it does on this game is likely very possible, and would only require a few custom actions

-- RageSpline is maintained with a set of PlayMaker Actions, and I think, it's now managed by Maddox, so I am sure that if you ask kindly, you'll get playmaker actions to modify shapes the way this game does.

-- as far as the actual physical behavior, this is a very simple drag and shoot concept.

   1: click and drag, record the distance.
   2: on release, add an force using the distance ( I would even dare trying the square distance for more spectrum) as a multiplier, and use the drag direction as the direction ( the opposite of it)

and done. so really, this is not a complex feature, nor a complex game at all. It's simply perfectly executed!

Without RageSpline, you would then have to modify the cube vertices themselves, which currently is not accessible within playmaker as standard, but I can provide with the necessary custom actions to do so. And Kiriri is right, MegaFier would indeed shine in this exercice with a 2x2x2 FFD box as the modifier.

The trick with stretching the cube and not the eyes is simple, and can be achieve in two ways at least:
-- the eyes is a different mesh... problem solved
-- the eyes uv is within a given set of faces, to that face is not actually made of 2 faces but 18 faces  ( 9 squares, with the center one being the eyes). Think of it like the 9-scales images or image caps in IOS.


So, totally feasible, even with PlayMaker with a bit of work on custom Actions. Using third party plugins like RageSpline will be mandatory of course if you want the exact same visual look obviously.


Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Can someone have a easy way of accomplishing this??
« Reply #3 on: November 13, 2012, 06:23:48 AM »
Hi,

 ok, working sample for you guys :)

 You need MegaFiers, but the rest is only PlayMaker and a few custom Actions.

If you don't have megaFier, simply delete the offensive action file ( you will get a warning in the console), and the rest of the feature will remain ( only the cube will no stretch).

 It works on IOS and with the mouse too. so you can test during editing as well. It also shows how to implement a dragging feature that works both for touch and mouse.

It's also a very good sampel to see how to trick Unity to work in 2d, and how you can cheat on GameObject layout to achieve what you want, for example the cube collider is not where the actual mesh is, and the composition of the cube is tricked to allow the deformed mesh to always be on top of the platforms and the playmaker logo in between the collider responsible for dragging and the shape. so quite a lot of fun tweaks here to study.


 Bye,

 Jean

Redhawk

  • Junior Playmaker
  • **
  • Posts: 57
Re: DragAndShoot, how to do this like rageCube?
« Reply #4 on: June 03, 2014, 01:42:38 PM »
Maybe I deleted too much, but this doesn't work for me on an Android tablet.