What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-15 23:01:02
unity dash script
public vector3 moveDirection; public float maxDashTime = 1.0f; public float dashSpeed = 1.0f; public float dashStoppingSpeed = 0.1f; private float currentDashTime; void Start() { currentDashTime = MaxDashTime; } void Update() { if (input.getBu... Add solution -
C# 2021-09-15 11:01:04
unity move object from another script
// 3D transform.position = new Vector3(GameObject.Find("Object").transform.position.x, GameObject.Find("Object").transform.position.y, GameObject.Find("Object").transform.position.z); // 2D transform.position = new Vector2(G... Add solution -
C# 2021-09-15 04:32:02
unity making homing missile
//using the cross-product is quite effective //Note: This is quite usefull for rigidbodys... //but you can also use that for transform with some code adjustments Vector3 targetDir; Vector3 currentDir = transform.forward; //whatever your currentDir is /... Add solution -
C++ 2021-09-14 23:41:03
eigenvalue of matrix c++ using Eigen
#include <eigen3/Eigen/Eigenvalues> // header file #include <iostream> int main(){ Eigen::Matrix<double, 2, 2> A; // declare a real (double) 2x2 matrix A << 0, 2, 1, 0; // defined the matrix A Eigen::EigenSolver<Ei... Add solution -
Java 2021-09-14 19:48:03
Rotate Vector by an angle
var rotateVector = function(vec, ang) { ang = -ang * (Math.PI/180); var cos = Math.cos(ang); var sin = Math.sin(ang); return new Array(Math.round(10000*(vec[0] * cos - vec[1] * sin))/10000, Math.round(10000*(vec[0] * sin + vec[1] * cos))/1... Add solution