I have something like this (it's only a movement ripped from project)
There are two thing I'cant work out for last couple of days. Been trying different methods to do what I want but with no success. And finally I found out custom movement is more less best choice to go with.
1. There is a sprite "Leader" with custom movement behavior moving to mouse click position. It moves on empty area of Tilemap object.
It works fine until it collides with occupied tile.
What I want to do is to move "Leader" as close to mouse clicked position as possible, but don't know why it works only if sprite is colliding with tile on bottom. Like on image below
<img src="https://dl.dropboxusercontent.com/u/34375299/Construct%202/bugs%20and%20fixes/customMovementHelp.jpg" border="0">
If I click somewhere on highlighted on blue area "Leader" will move on X (horizontally ;p) and stops really close to X position of mouse click.
Like I said it works only for this situation. If it collides with tile on top, left or right it will keep sliding all over the place.
Why it's happening?
2. For this You must toggle on event 1 and 9.
It's basically "Pin chain style.capx" from examples folder.
I'v added a custom movement behavior to Family1, so all "Follower" Sprites can move behind "Leader" and around solid tiles.
Now things are really interesting :D
"Follower" Sprites are indeed moving around obstacles as they should but "Leader" starts to jump all over the layout on every collision...
All I need is to "Leader" stop or slide to closest position of mouse click and "Follower" to move around solid tiles. It doesn't need to be perfect or pixel precise because "Leader" and "Followers" sprites are only bases of movement for other sprites that follow them with lag - I didn't include them in file cause they are irrelevant. So they can collide and overlap each other.
Any help will be appreciated, and thanks for reading :)
Develop games in your browser. Powerful, performant & highly capable.