Physics prismatic joint

GameMaker Studio developers

Physics prismatic joint

Physics prismatic joints are those meetings that limit their movement towards one direction. The affected object follows an imaginary guide through which it travels and we are allowed to assign an engine to operate it autonomously.

SoloStudio Tech Youtube Channel


1.0 – Setting the physics

As usual in the physics section, we will adjust the physical properties of 2 objects. The first obtains physical properties, but assigning a density of 0, as you know, this value will make our instance static.

The second object will have a density of 1 and we will apply a prismatic joint from the PHYSICS PROPS panel.


1.1 – Joint settings

Once this initial configuration is done and we are in the SET JOINT panel, all the variables that we can adjust for this type of joint appear.

The functions are varied, from assigning the address to activating a custom engine.

This type of joint allows us to limit the displacement of our object in a pixel range. For this we find the variables LOWER TRANS LIMIT, which adjust the limit of your local position, and UPPER TRANS LIMIT, which limits how much distance you can travel.

In the image below we observe that we have already assigned a union (delimited by the red line) in the same way as we have done in previous articles.

Once this is done, we can only press and drag our mouse at the indicated points to measure the distance that our object will travel.

When we start the simulation, we observe the guide through which our instance travels. Once our object reaches the end of that guide, it stops from the coordinates of its center of mass. This limits the trajectory of our platform and prevents it from falling into a vacuum.

It is up to the user how he wants to take advantage of this tool, with which we can direct the joint in the desired direction, give it driving force and even combine this element as part of a different mechanism.

We will talk about the latter in the Gear Joint tutorial, where we will be allowed to create a joint between two joints of the same type or combine it with one of rotation.


Recommendation:

We strongly recommend that you view the video located at the beginning of this article to get a clear idea of this section.

The video tutorials provided on the YouTube channel support subtitle contributions from users. This means that any user can contribute to add subtitles with the editor and the new contribution program of YouTube subscribers.


Here concludes this brief tutorial! We have not seen it necessary to give detailed explanations about this type of meeting, since it shares many similarities with previous articles.

Now that you know how to access it, the best way to learn how to use these techniques is practice. So without further delay … What are you waiting for to start creating?

We send you our best regards and see you in the next article!

You may also like:

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.