johnhex Posted August 22, 2019 Share Posted August 22, 2019 From the Example of Pixijs SpineBoy, is there a way that SpineBoy can Follow Mouse Movement, i want his gun to follow mouse movement. can i control that using his json file? is there any other way around? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 22, 2019 Share Posted August 22, 2019 yes, same as in default spine-ts runtime. Look at esotericsoftware site and repos. I can make pixi demo later, but really - its an easy thing in all spine runtimes, whether its unity, pixi or whatever Welcome to the forums! Quote Link to comment Share on other sites More sharing options...
johnhex Posted August 22, 2019 Author Share Posted August 22, 2019 Like this ? ? I'll Try doing what you suggest, but I'll be a great help if you could make an example ? thanks. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Velith Posted August 22, 2019 Share Posted August 22, 2019 Hi, It should be something like that : // 0. Listen which Pixi mouse event that you want (here PointerDown) stage.onPointerDown = (pixiEvent) => { // 1. Get the bone/constraint that you want to move using mouse const target = mySpineObject.skeleton.findBone("target"); // 2. Modify it's coordinate with the mouse event of pixi target.data.x = pixiEvent.data.global.x; target.data.y = pixiEvent.data.global.y; } Not test.. ivan.popelyshev and johnhex 2 Quote Link to comment Share on other sites More sharing options...
johnhex Posted August 23, 2019 Author Share Posted August 23, 2019 Hello guys I still have problems with spine-ts, can you give an easy example base on SPineBoy? ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 23, 2019 Share Posted August 23, 2019 Just after I do other 20 or so requests from different forums and chats in in the queue, maybe I pick them by random. I asked guys from pixijs slack to do it and you now have one advice from @velith Did you actually find something good? HWhy do you think you failed? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.