dhtaya.blogg.se

Unity forward vector 2d
Unity forward vector 2d











A value of 0 mean instantaneous movement. Time to Ground Speed - The time, in seconds, it will take to reach ground speed. Caution as more raycasts are more expensive. Half the size of the motor then it should be 1. A good way to think about it is if the smaller environment is at least the size of the motor then this can be 0. Increasing the number of additional raycasts can fix this issue.

unity forward vector 2d

The raycasts can miss if the environment is small enough. The motor will be more efficient.Īdditional Raycasts Per Side - By default the motor will raycast through the corners to separate itself from moving platforms (or static environment if moved into one by a moving platform). If there aren't any moving platforms then make sure this value is 'Nothing' (or 0). This requires that 'Raycasts Start in Colliders' is true in the Physics 2D settings. The motor uses this knowledge to grab a MovingPlatformMotor2D component from the platforms. Moving Platform Layer Mask - What layer contains moving platforms. If it can then setting this to false won't help, one way platforms or not. This will only have an effect if the motor's collider can't collide with its own layer. 2 iterations will likely cover most cases (unless the time step is really long).Įnable for One Way Platforms - Should the motor check for one way platforms? Uncheck this if there aren't any, the motor will be more efficient. Lower numbers mean more performant but at a cost of potential position loss. Number of Iterations - The number of iterations the motor can take to resolve the final position during a tick. Half distance of the Environment Check Distance is probably pretty good. This is used to prevent catching matching edges of box colliders (or tiles). Minimum Distance From Env - This is the minimum separation between the motor and surrounding environnment. These are environments that shouldn't be able to move into the player.Įnvironment Check Distance - This is how far out the motor will check for the environment. Static Environment Layer Mask - This tells the motor what layer collisions to consider the environment (to determine if on the ground, wall, or corner). PlatformerMotor2D Inspector Properties General The motor uses the bounds of the Collider2D to understand where to check for contact with surfaces. The motor requires that a Collider2D be present on the GameObject. Requirements of PlatformerMotor2D BoxCollider2D There is no guarantee made that variables names won't change and if they do then the old values will be lost in the inspector. When upgrading take a note of your current motor values before upgrading.

unity forward vector 2d

For more complicated interaction, interface with PlatformerMotor2D's members and methods.

unity forward vector 2d

Setupįor immediate player support, drop the Basic Player Controller prefab into the scene and set the Static Environment Layer Mask field. Please open up an issue if there are any problems.

unity forward vector 2d

This isn't a perfect solution but allows it to work within Unity's physics system.Īlso I am no longer using the platformer controller in my own personal projects so it's not getting the personal testing it deserves. Make sure Environment Check Distance and Minimum Distance From Env need to be increased from what they were in Unity 5.2 (default is 0.08 and 0.04). Unity 5.3 appears to change the behavior of ray/boxcasts which PC2D relies heavily on.

#Unity forward vector 2d download#

If you'd like the most up to date version (which is the most cool), then pull the repo or download it here and copy the files in Assets to your project's Assets folder. Includes a player controlled prefab that can be dropped into any scene for immediate support. A customizable 2D platformer motor that handles mechanics such as double jumps, wall jumps, and corner grabs.











Unity forward vector 2d