Help Constraining a Block

LuMa GamesLuMa Games USAMember Posts: 129
edited November 2014 in Miscellaneous

I am spawning a block at a random X position (and the same Y position is the same every time). The block then falls down to the ground where my actor can jump on top of them.

The problem is that my actor is able to move these blocks if he collides with them. Now I could just put the blocks density higher and that seems to work somewhat, but my main character can still move them just the slightest bit. I want them to be non movable - only to my main character...

Now I know you are thinking: "why don't you just constrain the block's x position?" Well that doesn't work because I have to put in a value to constrain it to, and the value is random each time. (If I put in a random value to constrain it to, it jumps all over the screen) I have also tried constraining the blocks Linear Velocity on the X axis to 0, and for some reason that doesn't do anything. Any thoughts?

Comments

  • LuMa GamesLuMa Games USAMember Posts: 129

    Well guys, no need to answer. I figured it out FINALLY. I've been trying to fix this for HOURS. I just now came up with an idea that worked...

  • colandercolander Member Posts: 1,610

    @Luma you should always post your fix so others who are searching and looking for an answer for the same or similar problem can find a solution.

  • LuMa GamesLuMa Games USAMember Posts: 129

    @colander said:
    Luma you should always post your fix so others who are searching and looking for an answer for the same or similar problem can find a solution.

    Okay, what I ended up doing was making an actor attribute on my block prototype, an integer call "My X Position" I then put a rule on my blocks to change "My X Position" to it's X position when it spawns into the scene. I then made another rule right after that one which constrains the blocks X position to "My X Position"

Sign In or Register to comment.