What do you want to save?
Add Code snippet
New code examples
-
C# 2021-08-31 14:28:01
unity mobile controls
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Movement : MonoBehaviour { //variables public float moveSpeed = 300; public GameObject character; private Rigidbody2D characterBody; private float ScreenWid... Add solution -
C# 2021-08-31 01:44:01
how to make a camera follow an object in unity 2d
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraController : MonoBehaviour { //Object you want to follow public Transform target; //Set to z -10 public Vector3 offset; //How ... Add solution -
C++ 2021-08-30 23:29:01
sfml mouse click
if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) { // left click... } // get global mouse position sf::Vector2i position = sf::Mouse::getPosition(); // set mouse position relative to a window sf::Mouse::setPosition(sf::Vector2i(100, 200), window); Add solution -
C++ 2021-08-30 14:57:01
c++ find object in vector by attribute
std::vector<Type> v = ....; std::string myString = ....; auto it = find_if(v.begin(), v.end(), [&myString](const Type& obj) {return obj.getName() == myString;}) if (it != v.end()) { // found element. it is an iterator to the first matchin... Add solution -
C# 2021-08-30 07:37:01
set player position unity
transform.position = new Vector3(0, 0, 0);//x, y, z Add solution