How do I offset a spawned actor to mouse position?

JCFordJCFord Member Posts: 785
edited November -1 in Working with GS (Mac)
On a mouse click I am spawning an actor as follows:
SPAWN
POSITION: game.Mouse.Position.X
POSITION: game.Mouse.Position.Y

This works fine so wherever I click the actor will spawn right in the centre of the mouse click. I now want to offset this actor so it is above the mouse click by say 25 pixels. I have tried various combinations such as POSITION: game.Mouse.Position.Y +25 but nothing seems to work?

Comments

  • RHRH Member Posts: 1,079
    have you set them relative to the scene rather than your spawn actor?

    It works perfectly for me when I just tried it.
  • JCFordJCFord Member Posts: 785
    Yeah got it set to scene, I'm sure this should work too, but its not for me. I think I might try a new project and just set this up on its own to check it works.
    Thanks
  • JCFordJCFord Member Posts: 785
    Just tested in a new project and it works fine, now to find out why its not working in my current project - oh fun!
  • gtasickgtasick Member Posts: 15
    i'm having just the opposite problem ... my actors are spawning off screen and falling to the ground ... rather than spawning where i click? I have things set same as above? Except it's not supposed to spawn from another actor ... just spawning in space where the mouse is clicked.

    I created a new project just to test this and it's the same problem

    Any ideas?
  • gtasickgtasick Member Posts: 15
    ok i got it to work in it's own file ... but now when i go back to my project where i need to spawn bombs that then explode upon hitting blocks ... it will only allow me to spawn a few bombs then spawn no longer works?

    Note: bombs and blocks where made to explode using the blast tutorial.

    How do i make it spawn unlimited bombs? Or is my problem just a bug?
  • gtasickgtasick Member Posts: 15
    i figured out the problem, my invisible control box was movable and did not collide with anything so it just fell off the screen without me knowing and stopped working.

    just made it immovable and it fixed the issue.
Sign In or Register to comment.