Announcement

Collapse
No announcement yet.

Model rotation on SpawnActor with mouse X cursor (main) / touch swipe (seconday) 4.14 or higher

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Model rotation on SpawnActor with mouse X cursor (main) / touch swipe (seconday) 4.14 or higher

    Hi all, I am 3D Modeler/rigger/level designer. Kinda new in blueprints.

    My first question - How to create X or Y or Z Rotation for a "SpawnActor Class Skeletal Mesh" from X 0.0 Y 0.0 Z 0.0 ? (4.14)

    So, I have HUD Widget, Player Start - points on a SpawnActor X 0.0 Y 0.0 Z 0.0 with Skeletal or Static Mesh (depends on users choice) (Models are switching with buttons on HUD widget 1/2/3/etc).

    How to get an mesh rotation with cursor (main) or touch swipe (secondary) for a SpawnActor ?

    https://ibb.co/jdvU5a <--- !01_Viewport

    https://ibb.co/buBQdv <--- !02_WidgetDesigner02

    https://ibb.co/nFW2Qa <--- !03_WidgetBLueprint


    I've tried many different blueprints from other users - one from them is worked pretty good (even on an android mobile device), but that blueprint doesn't working with mine SpawnActor for Static or Skeletal meshes, its worked through the Camera Spring Arm Skeletal Mesh.



    One of them is very good https://www.youtube.com/watch?v=EUYYiyc3NVQ , but blueprint unknown - I cant identify without screenshots)


    1st in Proj settings create an Input like the 'Turn' one under Axis..

    call it something like TurnObject, and assign Mouse X.

    Then you need to create a 'condition' in a Class Blueprints that says maybe, when I am close to or click on an object,

    Make a custom variable, lets call it "objectclicked".

    If that is FALSE, (nothing clicked) the player controller will act as normal, and turn the user/player.

    If TRUE, disable the player character, and in Blueprints setup an area that will turn Object using the TurnObject Input...

    From InputAxis Turn Object - connect to A of a Multiply, in the B put -1.

    Feed that output into a MakeRot (YAW) node.

    That output goes into a DeltaRotation of a AddLocalRotation, with the target being your Object/Item (usually created as a variable with that object assigned to that variable).

    Then connect the InputObject into the input of the AddLocalRotation. Thats roughly how to do it.

    PS. Thanks a lot
    Attached Files

    #2
    Here's a good tutorial to make a playercontroller from scratch.

    http://shootertutorial.com/2015/06/0...se-touch-tilt/

    In the example he is using it to control the player lookaround but obviosuly you can also use it to control different objects with a reference. I found that tutorial quite helpful as i never used touch controls before and they are rather simple if you look at it - we store the "last touch" variable and just substract it from the current touch. Bonus: he also adds sensitivity settings which were really helpful.
    My Patreon page (UE4 goodies!)

    Comment


      #3
      Thanks for tips Fronzelneekburm.

      I will see them on a free time.

      Currently wip on mine version with Spring Arm (almost done).

      If someone has more information please share.

      Comment


        #4
        I've made mine own version its works from Camera Spring Arm. Thanks all, its can be closed. I have one more question, but for new topic

        Comment

        Working...
        X