Announcement

Collapse
No announcement yet.

Need Guidance - Rotate an Object by Touch

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

    Need Guidance - Rotate an Object by Touch

    Hi folks, I' m a Unity guy trying to get up to speed with UE4. Many things have have come into focus in learning UE4, but I'm a curious how one might perform this relatively simple task.
    Import an object (or use a simple primitive), and be able to rotate it via touch on a IOS device (getting this to go in the simulator is just fine as building to a device is another matter).

    I don't need or want joysticks, so I imagine I would create a blueprint with static mesh, set it to movable (or possible not as I don't want it to move, just spin).
    I imagine I could use physics, as it should have a certain amount of inertia to come to a stop, not just spin infinitely. I guess I would enable touch events in the Inputs section, and add 'On Input Touch Enter' to the object collider?

    Does this sound aprox in the right direction? Any input (pardon the pun), would be might appreciated.



    Happy New Year to All!
    B.

    #2
    Just to clear up some terminology, when you say 'on touch' are you referring to an IOS touch screen event, or do you mean "When this object is touched by the player object" or something similar?

    Both would be handled similarly, only difference would be the event you use. In the actor's blueprint you can right click on any of your components and add an event, such as "OnInputTouchBegin" and then you can wire the execution not from that to a node such as "set actor rotation" or similar.

    So the process would be, in your static mesh blueprint, add a collision component (or use collision on your static mesh) and then right click that component in the list in the left pane and add an event of the type you want, then wire that up to whatever you want to have happen when the event triggers.
    Trevor Lee

    Comment


      #3
      Thanks, Trevor,
      Yeah, basically, think of it as a simply object viewer. An object, floating in scene space, but can be freely rotated or stopped by the touch of a finger on the ipad / iphone screen. As if you were examining it.
      Of course the object could be more complex, perhaps have animated/moving parts that can be triggered to play/move when tapped, ( Imagine a very simplified 'The Room'), type interaction.

      The input system is quite a bit different than Unity, but I imagine that the logic would be pretty much the same.

      Comment

      Working...
      X