KBSnyders Posted May 25, 2020 Share Posted May 25, 2020 With the Pixi Viewport library - it makes it really easy to set up a "camera" in a way. It's all cool - but I've noticed something - when you follow a sprite, it'll follow it just fine going in one directPlion, and the camera will ease nicely after tweaking the options. But then, when I want the sprite to go in the opposite direction - it needs it to get right up on the edge almost before it moves. Anyone have any clue how to make this better? Played with these - https://davidfig.github.io/pixi-viewport/jsdoc/Viewport.html#follow Quote Link to comment Share on other sites More sharing options...
Galious Posted May 28, 2021 Share Posted May 28, 2021 (edited) I had the same problem, I figured out that the problem was that the ticker was not the same like the app uses. (The default from pixi-viewport is Pixi.Ticker.shared) So the answer was to set the ticker with the right one: const viewport = new Viewport({ worldWidth: 50000, worldHeight: 50000, screenHeight: 720, screenWidth: 1280, ticker: app.ticker, }); Edited May 28, 2021 by Galious 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.