thanks dude, i cant wrap my head around using mouse inputs/positions so this short tutorial is a blessing
@TheSillyDoggo
11 ай бұрын
I was trying to get a camera that moves like the geometry dash level editor and this was perfect. Thanks :D
@joebeerlobe
9 ай бұрын
same!
@Justin-dn7ex
2 ай бұрын
Question. at 4.07 when i go into events, drag the MainCamera across and change function, I click CameraDrag in the dropdown list, I do not have 'OnDrag' in the drop down sub-menu. My drop down list starts at 'static parameters' then bool enabled. I don't have the greyed option Dynamic nor the 'OnDrag' to select that appear in the video. How do I resolve this? Is this an error in coding or a function i have not downloaded?
@Justin-dn7ex
2 ай бұрын
Figured this out, i added it to Device Lost Events, not Gameplay. My code was also missing a few ";" on line ends. This is really excellent and simple tutorial to follow and works a charm (as long as the code I write doesn't have errors!) thanks muchly 🙂 it conflicted with my follow player camera, so I had to add change the script execution order in the preferences.
@pantheroathz4734
2 ай бұрын
This is an awesome tutorial but idk why I can't shoose the "mouse, right click button" I can only see "Value", "Button" and "Pass through" so I can't choose it? Also close to the end at PlayerInput -> Events -> Gameplay -> NoFunction -> CameraDrag I can't find the "OnDrag" button? Have I maybe not installed something? I don't know
@pantheroathz4734
Ай бұрын
the first issue was resolved, but I still don't know how to solve the second problem..
@melrellid
Жыл бұрын
I cant get it to work. I followed your tutorial precisely, but its like the ActionInputs doesn't ever get triggered. :(
@TomGibson.
Жыл бұрын
I too am having trouble getting it to work
@TomGibson.
Жыл бұрын
Ok I figured it out, to get it to move like in the video you need to set the z coordinate of the mouse position as well. it's only a small change to the GetMousePosition part, i made it so that the Mouse.current.position.readvalue is now put into a vector3 variable instead of being used directly. Then i set the z coordinate manually to 24 (because my camera is located at -24 in the z coordinate and my 2d game is located at 0 in the z. then i return the maincamera.screentopoint only this time with mousepos in the brackets. no other code needs changing, if you followed the video exactly then this solution should also work for you :) private Vector3 GetMousePosition() { Vector3 MousePos = Mouse.current.position.ReadValue(); MousePos.z = 24; return MainCamera.ScreenToWorldPoint(MousePos); } ps sorry you might need to change a few variable names when copying it over sorry
@Tony-cm8lg
11 ай бұрын
@@TomGibson. Interesting, In the video he casts the Vector2 directly to a Vector3 which I guess sets a different value for the z coordinate.
@TomGibson.
Жыл бұрын
Hi, to anyone else struggling to get this to drag, at 3:27 try replacing: private Vector3 GetMousePosition => _mainCamera.ScreenToWorldPoint(Mouse.current.position.ReadValue()); with: private Vector3 GetMousePosition() { Vector3 MousePos = Mouse.current.position.ReadValue(); _mousePos.z = 24; ////////////////////////////////////////////////////////////////distance game is from your camera return _mainCamera.ScreenToWorldPoint(_mousePos); } you need to set the z coordinate to the distance your game is from the camera, for example my camera is at -24 in the z and my game is at 0 in the z. so i set _mousePos to 24
@jonatanjonsson7503
2 ай бұрын
Pratar för fort dock. Tur att det finns x0.75 på YT!
@cake8242
2 ай бұрын
it just works for "Game"(Computer), not for Simulation(Mobil), pls make it working for Mobil too
@haaremy
Жыл бұрын
I cannot set the Function in Events/Gameplay
@pantheroathz4734
Ай бұрын
same...
@Noth0ng82
2 ай бұрын
I made the script and attached it to the camera object, but when I choose the function in device lost event, onDrag isn't showing, why is that
@Noth0ng82
2 ай бұрын
never mind, I didn't see the game play key he pressed, but it isn't working
@pantheroathz4734
Ай бұрын
@@Noth0ng82 have u found a way to make it work? Bc I have the same issue
@eraykoseoglu
11 ай бұрын
Hello, how to make it work on mobile?
@marvinvideostudioofficial
3 ай бұрын
4:07 Tried everything but it dosen't give me "OnDrag"
@marvinvideostudioofficial
3 ай бұрын
UPDATE: i got confused and didn't pay attention
@pantheroathz4734
Ай бұрын
@@marvinvideostudioofficial hey, I have the same problem, can u tell me, what I might've missed?
@trananhpham7256
Жыл бұрын
how can i restrict the coordinate let's say x and z
@chunkybacongames
Жыл бұрын
Would my latest video be of any help?
@cake8242
Ай бұрын
@@chunkybacongames What do I need to change to make it work for mobile (simulation)? I think I need to change the path from the mouse to the touchscreen, but that doesn't seem to be enough, pls help
Пікірлер: 27