Skip to content

Page1: General description. Installation. Use.

filln edited this page May 7, 2020 · 6 revisions

A general description. Installation. Usage.

Short description.

The plugin is intended to transform (move, rotate, scale) the actors in the game. Transformations are controlled by the player. Transformation parameters depend mainly on the coordinates of the mouse cursor and the value of keys on the keyboard, ie control is performed by the mouse cursor and (or) the keyboard.

Moving is possible both in the screen plane (with the mouse cursor) and in depth (as a variant of the mouse wheel). As the character can move at transformations, it can "carry" an object with itself. When you control the keyboard you use a custom SceneComponent for axes of movement.

Rotation is possible in four variants: Pitch and Yaw, Roll, Pitch, Yaw for mouse cursor and Yaw, Roll, Pitch for keyboard. You can specify SceneComponent, from which axes of rotation will be taken. For example, the character's camera. If the component is not set, then the character's axes will be used.

Scaling is performed simultaneously in three axes when controlling the mouse cursor and selectively when controlling the keyboard.

The plugin has a built-in TransformActorInterface and dispatchers. They are triggered in four events: selection of the transformation mode and exit the mode, the beginning of the actor control and the end of the control.

The only actors that inherited (or implemented in the class settings in Blueprints) from the TransformActorInterface will be transformed

The following control steps are used:

  1. The type of transformation is selected. This can be done, for example, with a keyboard or a widget.
  2. Selects the actor to be transformed. This is done by clicking on the actor. In this case, the interface method for the selected and previous actors is triggered. If you click on the selected actor and move the cursor without releasing the mouse button, the transformation is performed.
  3. At that the delegate and the interface method will be triggered. If you click on the other actor, see step 2.
  4. If you release the mouse button, the delegate and the interface method will be triggered.
  5. Switching the transformation mode off. The delegate and the interface method are triggered.

When controlling the keyboard:

  1. Set PlayerController and PlayerPawn, select the GameAndUI mode to activate the mouse cursor.
    1. The mouse cursor is the actor, tested on the interface, memorized. The corresponding interface methods and dispatchers are called up.
  2. The keys are used to perform transformations.
    1. Shutdown: Select the GameOnly mode, zero the variables, and call the appropriate dispatchers and interface methods. If desired, you can select the actor without the mouse cursor in some other way. Combinations of Basic Group methods allow this.

Installation.

When installing from Marketplace, select the version of Unreal Engine.

When installing manually, go to [Releases] (https://github.com/filln/UE4-TransformActorsPlugin/releases), download the archive for your version of UE. Place the contents of the archive in the YourProject/Plugins folder. If the Plugins folder is missing, create it. Run the editor.

Open your Character or Pawn, add "Add Component" via menu "Transformation Actors":

AddComponent

Use.

See the finished project (34 Mb), in which you can see and try this plugin: UE422_TransformExamp.zip.

After adding a component, you need to assign events to the main methods. For example, the keys of the keyboard: KeyboardInput

You can define the component from which the rotational axes will be taken: BeginPlay

You can lock the camera rotation with the mouse while transforming. This may be more convenient: CharacterMouseInput

For full work with actors you need to add them TransformActorInterface and define the interface methods: AddInterface SetInterfaceEvents

It is possible to assign delegates, but so far I have not found any use for them. I hope you can use them.

All plugin component methods are divided into two groups: General and Basic. General methods are the main methods, which consist of methods of the Basic group. General methods play the main role in plugin's work and are called, for example, by pressing keys. All methods are available in Blueprints. So you can make your own logic of plug-in's work from methods of Basic group within certain bounds. For example, you can control how GameAndUI mode is turned on when the mouse cursor appears, or you can programmatically select an actor to transform. However, it's also possible to break everything.

Page2:-Description-of-methods-and-variables.