Experimenting with Unity: Player Movement - Rotation

August 1st, 2018

Experimenting with Unity: Player Movement

Player controlled by rotation about a point

Vimeo - Video of Rotational Movement

I was experimenting with controlling a player agent solely through rotational forces. The first style I looked at was not a force in the physical sense as it just operates on moving the player at a constant rotation speed. This is dictated by the placement of a rotation pivot which the player can place to indirectly move the player agent.

To add an extra amount of control, the player can also press a key in order to reverse the direction of the rotation (switch between clockwise and counterclockwise). This combination of features led to some interesting movement patterns. One of the first things that jumps out is the fact that the movement being dictated by a constant rotation speed still leads to varying velocities by the player agent as this will vary drastically with the radius between the pivot point and the player object. Large pivot distances can lead to dramatic speeds, but will lead to the player covering a larger area.

Notes to remember:

I was having an issue where the rotation was not perfectly making a circle in the game view. It turns out the scripts were correct, but the camera needed to be set to orthographic so the camera was just viewing it at an angle. Remember to check both the editor view and game view closely to help determine camera-based issues.

Using cursor inputs in Unity is a bit awkward. It has been done plenty of times so the basic scripting is available on Unity's main site, but the process of creating a plane, raycasting, and converting between screen and world space is a lot to keep track of. This might also be something to look into if mouse inputs are acting strange.

Comments

Popular posts from this blog

Online Multiplayer Networking Solution Tutorial Using Unity and Mirror - Tutorial by: Jason Weimann

Exporting FBX from Houdini with Color

Houdini Assignment - Fuse and Group