How to spawn actor with touch on a movable screen?

I have a primary actor and a secondary actor. The camera will follow the primary actor while the secondary actor is spawned at the point where I touch the screen. When the level start, before the camera start to follow the primary actor it works fine. But once the camera follow the primary actor I can no longer spawn secondary actor at touch position. The secondary actor will always be spawned on the main frame(i.e the screen at the start of the level). Any solution guys?

Answers

  • SocksSocks London, UK.Member Posts: 12,822

    @dark.ling said:

    Add the camera offset to the touch position.

    So intend of spawning at . . .

    Mouse.position.X

    Mouse.position.Y

    Spawn at . . .

    Mouse.position.X + Camera Origin.X

    Mouse.position.Y + Camera Origin.Y

  • dark.lingdark.ling Member Posts: 1

    Ah that works.
    Thanks Socks.

Sign In or Register to comment.