- Home /
Question by
patrick750 · Dec 01, 2019 at 03:22 AM ·
prefabplatformermouseposition
Creating platforms based on mouse position
Hiya,
I'm very new to Unity. I've been trying to write code that will take the user's mouse position on mouse down, then on mouse up and place a prefab. The prefab would then be stretched to fit the dimensions of the rectangle the player 'drew' with their mouse.
So far I have tried doing this via placing it and updating the SpriteRenderer component. This would place the prefab of varying sizes, but couldn't figure out how to align it, scale it the way I wanted.
Also tried using Rect to build a rectangle and trying similar things.
Could someone point me in the right direction?
Comment