![]() ![]() However it doesn't work if i impose a resolution. This seems to work when the Game window of the editor is set to "Free Aspect". There was still a costant offset, so i had to correct based on the difference of the size. So i used their ratio to correct the scaling. Instead of using the canvas as the scaling, i noticed that my Cinemachine Ortographic Size (7.5) was different from the Pixel Perfect one, and the first one was the one actually used to perform the calculation. MousePos.y -= 7.5f - pCamera.orthographicSize MousePos.x -= (7.5f - pCamera.orthographicSize) * pCamera.aspect Using the Canvas.scaleFactor doesen't seem to correct the scaling, but on the line of that i tried this: Vector2 mousePosScreen = new Vector2(, ) * 7.5f/pCamera.orthographicSize I think the Pixel Perfect camera is the culprit here too. Player sprite jitters when moving, tried changing cinemachine brain properties, nothing helps. Overview The 2D Pixel Perfect package contains the Pixel Perfect Camera component which ensures your pixel art remains crisp and clear at different resolutions, and stable in motion. Here's simple setup to catch the problem: simple player movement, pixelperfect camera, cinemachine camera with cinemachine pixel perfect script, resolution 640 x 360, PPU 32. The red dot is the returned position, while the mouse cursor is the real position.Īpparently it was something concerning unity/the package itself and updating to the newest version (currently 2021.3.9f1) completely solved the issue. Posts: 2 Hello I'm sorry for my bad english. However, the position returned is completely incorrect. Where pCamera is the reference to the Camera component in the MainCamera object. This version of Cinemachine is supported by the following versions of the Unity Editor: 2019. To get the position of the mouse, i use this code: Vector3 mousePos = pCamera.ScreenToWorldPoint(Input.mousePosition) There are similar ifdef -protected behaviours for other packages, such as HDRP Volumes, Timeline, and Pixel-Perfect. I am trying to setup a pixel perfect camera for my 2D game using Cinemachine component and the Pixel Perfect Camera component, and in-game i also need to get the position of the mouse in the world. r/GameAudio - It may look good, but does it sound good? r/LevelDesign - Learn to make excellent levels and worlds. r/GameDev - Meet and communicate with other game developers. The level tiles we have prepared are 16×16 so I’ll set the ‘x’ and ‘y’ components to 0.16. r/PixelArt - Admire, share, and observe beautiful pixel art. Since we want to preserve the pixel-perfect look across majority of resolutions, we are going to set the ‘Cell Size’ fields accordingly. unit圓D on 8chan - Unity-focused image board Unity 2D forums Tutorials Filter Wiki List Im using pixel perfect camera > 32 PPU (ref res X 480 Y 320) Cinemachine brain with Fixed Update for the Update Method. Be familiar with Reddit's Rules, Reddiquette, and Self-Promotion Guidelines.If the content is not related to 2D/2.5D development, it may belong in /r/Unit圓D or /r/GameDev. That's not a real solution since I need to use a PixelPerfect component (with the ability to Zoom)./r/Unity2D is a subreddit for news, tutorials, feedback, resources, and conversations related to 2D or 2.5D game development using the Unity game engine. I found out that disabling the "Pixel Perfect Camera (Experimental)" component on the Camera solved the problem. Even if it's the only vcam enabled, it's not zooming. I mean, everything else works, the rotation, etc, everything but the zoom. To achieve that, I have added a 3rd "CM vcamZOOM".īut nope, it's not working at all. Now, I need to make a zoom on the player. (note : I'm aware there's another PixelPerfect component in the "2D pixel perfect" package, but it's only compatible with LWRP projects if I'm right.)ĬM vcam1 and CM vcam2 are used to make transitions between Areas. I feel that the right PixelPerfect component because it seems that it's the only one working for my project ahah. So I use the Camera component named "Pixel Perfect Camera (Experimental)". The CM PixelPerfect component doesn't work in my 2D Tilebased game. There are many PixelPerfect component that exists and it confuses me. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |