Locking position and rotation between actors

I am trying to make a game in which my car actor has a rocket actor attached to its back. I followed the game salad cookbook tutorial for connecting actors, but I want my car to go down a ramp, and when it does, the rocket moves around oddly. I also wanted to have on touch, flame actor appears and is locked to rocket position and rotation. Any ideas?

Answers

  • SocksSocks London, UK.Member Posts: 12,822
    This might give you some clues, I've constrained a few different boxes to one master box, as you can see they move and rotate with the master box:

    http://www.mediafire.com/?7avpfoxh72a8hw2
  • ccc2ccc2 Member Posts: 8
    That is almost exactly what I am trying to do. I just want the green rectangle to be on one of the sides of the white square, not on the corner. I am not sure how to do that because of the math that is involved in your current file.
  • ccc2ccc2 Member Posts: 8
    That is great, thank you, but there is one more part I need. I want it so that when touch is held, a "Fire" actor is spawned and is locked to the rocket, just how the engine is to the "Car". Would I just create more attributes just like the ones for the "car" and do it for the "Engine" and "Fire" actors?
  • ccc2ccc2 Member Posts: 8
    I just added the second group of attributes and did what you did with the green(Engine) and the white(car) actors and did it again with the green(engine) and my new red(fire) actor. The fire actor is following the engine and the engine is following the car properly now, but for some reason, the engine and fire have switched to the other side of the car. I am not sure why.
  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2013
    I am not sure why.
    . . . without seeing your rules I couldn't really suggest anything other than to just check everything for mistakes.
  • SocksSocks London, UK.Member Posts: 12,822
    @ccc2
    http://www.mediafire.com/?z58fab9fa5cnatg
    That is my file.

    Did you sort this out ? I can take a look if you still need me to.
  • ccc2ccc2 Member Posts: 8
    I still can't figure it out, so I would appreciate it if you would take a quick look at it.
  • SocksSocks London, UK.Member Posts: 12,822
    @ccc2
    I still can't figure it out, so I would appreciate it if you would take a quick look at it.
    Let me know what you want to go where.
  • ccc2ccc2 Member Posts: 8
    I want the green square to be "attached" to the left of the white square in the middle of the left side. I also want the red square to be "attached" the the middle of the left side of the green square. If you have time and wouldn't mind helping me take it one step further, I would ole it so that if the screen is touched, the the red square appears. Otherwise it is not there.

    Thank you
  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2013
    @ccc2

    Just spin game.A Rotation around by 180°.

    So . . . . 100*cos( game.A Rotation)+ game.A X

    Becomes . . . 100*cos( game.A Rotation +180)+ game.A X

    Hold on let me do it to the file . . . . . back in 2 minutes . .
  • SocksSocks London, UK.Member Posts: 12,822
    example attached:
  • ccc2ccc2 Member Posts: 8
    Thanks you, that is great. Now all I need is to have it so that when the screen is touched, then the fire actor is spawned, and it is otherwise not there. I tried having an actor cover the screen with 0 opacity, I had a rule that said, on touch, spawn actor fire. It doesnt seem to work.
  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2013
    . . . . It doesnt seem to work.
    Great info, I think (and this is only a guess) that something is probably wrong.

    ;)
  • ccc2ccc2 Member Posts: 8
    Something tells me that you are right. :-?
Sign In or Register to comment.