Mechropolis – The Grabber And It’s Chain

Grabber

We call this cute little thing the Grabber. It’s able to fire it’s claw at a distance and grab onto things. A clever player might lure it into pulling a lever that is out of reach, or fuse it with a Controller (a robot that enables a fusion to be controlled by the player) and hookshot over a chasm.

One thing about this robot that we knew would be a challenge when we designed it is it’s ability to fire the claw around corners by bouncing it off a Shield robot’s shield. This meant having the chain bend around corners in the environment. Mathias, another member of the team had already done some great work on creating a path for the chain that wraps around environment geometry and I took over where he left off, putting it to use in the game.

The path starts out as a line between two points, one fixed and the other attached to the moving claw. We call these points rope points. Whenever the claw hits a shield, it’s direction of travel is reflected in the normal of the shield’s surface and a new rope point is inserted just behind the frontmost point (the one with the claw) and positioned at the point of impact.

The path starts out as a line between two points.

The path starts out as a line between two points.

Whenever the claw hits a shield, a new rope point is inserted.

Whenever the claw hits a shield, a new rope point is inserted.

All rope points except for the first and last are constantly moving toward a position right in the middle of the points before and after it, tightening the path. The wrapping path is found by sphere-casting between each consecutive rope point every frame. If a hit is detected, a new rope point is created at the hit position.

The rope points are constantly moving toward a position between the previous and next points.

The rope points are constantly moving toward a position between the previous and next points.

If a sphere-cast hit is detected, a new rope point is created.

If a sphere-cast hit is detected, a new rope point is created.

In order to create the chain’s visual representation, I used Curvy, a plugin for unity that allows us to place meshes along a spline that we’ve previously used to create minecarts tracks. By creating a spline out of the rope points and placing instances of chain links along it, I was able to create a nice looking chain.

Originally, the chain would tighten as the claw moved through the air, but after some testing I decided to change this so that the tightening would not begin until the claw starts retracting. Hopefully, this will give the player a better understanding of the path that the claw travels when it bounces off a shield.

The end result.

The end result.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Theme by Simon Wulf