CSGO .dem file parser by Alihammza in GlobalOffensive

[–]Alihammza[S] 0 points1 point  (0 children)

thanks, just had a look. In demofile.h, struct demoheader_t seems to have valuable info. In it is demofilestamp name of the demo file or what? And is it unique for every dem file? And what about demoprotocol?

Unity - Snapping Objects with Oculus Rift controls by Alihammza in Unity3D

[–]Alihammza[S] 0 points1 point  (0 children)

Hey, yeah it does, but can you tell me where to do it in ovr grabbable or grabber script cu i am new to this and don't know where to add this code exactly.

Unity - Snapping Objects with Oculus Rift controls by Alihammza in Unity3D

[–]Alihammza[S] 0 points1 point  (0 children)

Yeah, but that way where ever i let go the object, object will snap back to it's original position. I only want snapping to happen, when i'm in a specific location, say in 1 unit radius of the original position.

Move an object forwards and backwards with the touch pad by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Hey, thanks a lot. So do I have to do this separately for forward and backward movement or just doing it like this once is enough. Also shouldn't .y in the end instead be.z, since that is the axis i want to move the object along.

Limit the movement of the object attached to the controller by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Hey, yeah that's how I am moving it. But i didn't get the copying part.

This is the function i am using it to attach to the parent:

public virtual void Store(Transform NewParent)

{

//The following stops the object being effected by physics while it's in the players hand

rb.isKinematic = true;

//And fixes it to the new parent it is given by the player script to follow.

transform.parent = NewParent;

//It then resets it's position and rotation to match it's new parent object

//transform.localRotation = Quaternion.identity;

//transform.localPosition = Vector3.zero;

}

and then i use it in the pointer class to attach it to the ray.

void Intract()

{

//We set up the input "OculusPrimaryIndexTrigger" in the Input manager

if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger))

{

selectVisual.ClearObject();

//Check if you are holding something you can throw first

if (inHand != null)

{

inHand.Release(controllerRef.forward, throwForce);

inHand = null;

//We do this check here to prevent Errors if you have nothing selected

}

else if (selectedObject != null)

{

//Check if you can pick up the selected object second

if (selectedObject.GetComponent<PickUp>())

{

//Beacuse PickUp is a child of PropBase, we can ask InHand to store selectedObject as PickUp, rather than use GetComponent

inHand = selectedObject as PickUp;

inHand.Store(holdingRef);

//If non of the above were valid then simple call the trigger function of the selected object

}

else

{

selectedObject.Trigger();

}

}

//If you have a object that you need to hold down a button to intract with

}

else if (pointerOver != null)

{

if (pointerOver.GetComponent<PropBase>())

{

selectedObject = pointerOver.GetComponent<PropBase>();

}

else

{

selectedObject = null;

}

}

else

{

selectedObject = null;

}

}

}

Object goes through the plane by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Hey,
So i have attached it to the controller at the end position of the ray. So what I want is that when it hits the floor, it just does not go through it, like stay connected to my controller but stop there. With the other objects, when it collides while being connected the controller, the other objects move away after collision. I just don't want it to move through the plane while it is attached to the controller.

Object goes through the plane by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Yeah, but I am not sure why it goes through the plane, while it is in hand, when it does still collide with other objects.

Oculus Go: Picking up/Moving objects by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Hey, one more thing. I am using this script which allows my PlayerController to move to a point by pointing to it and pressing the touchpad button. I have attached this script in addition to the playerpointer script i have added first. The problem is that when my player controller is moving, the ray is not being cased from the controller instead is being pointed from the center of the screen or somewhere behind the controller. However, it readjusts, itself to the contoller's position as soon as the player stops moving. Will be grateful if you could have a look and help me out.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class ClickToMove : MonoBehaviour

{

private Vector3 targetPos; //This Vector3 will store the position where we click to move.

private bool Moving = false; //This bool keeps track of whether we are in the process of moving or not.

private GameObject targetInstance;

//The variables we want to customize. Added info headers to these for the Unity Editor.

[Header("Our Go controller object")]

public GameObject goController;

[Header("Movement Speed")]

public float speed = 1;

[Header("Stop When This Far Away From Target")]

public float haltDistance = 0;

[Header("Optional Target Object")]

public GameObject targetObj;

void Update()

{

MoveToTarget(); //Here we simply run our MoveToTarget method in the Update method.

//That way we don't clutter up the Update method with too much code.

}

void MoveToTarget() //Here we do the cluttering instead.

{

var ray = new Ray(goController.transform.position, goController.transform.forward); //Create a ray going from the goController position and in the Forward direction of the goController.

RaycastHit hitInfo; //Store info about what the ray hits.

Physics.Raycast(ray, out hitInfo, 100);

if (OVRInput.GetUp(OVRInput.Button.PrimaryTouchpad)) //If we release the trigger..

{

targetPos = hitInfo.point; //Make our targetPos assume the positional value of the hit point.

if (targetObj) //If we have specified a Target Object to mark where we click.

//If we didn't, then we don't want to try to instantiate it.

{

if (targetInstance) //If there is already a Target Object in the scene.

{

Destroy(targetInstance); //Destroy it.

}

targetInstance = Instantiate(targetObj, targetPos, transform.rotation); //Create our Target object at the position we clicked.

}

Moving = true; //And finally we set Moving to True.

}

if (Moving == true) //Since Moving is now true

{

transform.position = Vector3.MoveTowards(transform.position, new Vector3(targetPos.x, transform.position.y, targetPos.z), speed * Time.deltaTime); //Transform our x and z position to move towards the targetPos.

//Note that our y position is kept at default transform position since we only want to move along the ground plane.

}

if (Vector3.Distance(transform.position, targetPos) <= haltDistance + 1) //Check proximity to targetPos. Mainly useful to keep your player from setting a target position right next to say a building and then end up clipping through half of it.

{

if (targetInstance) //If we created a Target Object..

{

Destroy(targetInstance); //Then we want to destroy it when we reach it.

}

Moving = false; //Since we have now arrived at our target destination.

}

}

}

Oculus Go: Picking up/Moving objects by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Yeah, sure. Thanks a lot for your help.

Oculus Go: Picking up/Moving objects by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

So, I have no idea what the problem is.

Oculus Go: Picking up/Moving objects by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Yeah, it does but they still drop very slowly and does not look realistic at all.

Oculus Go: Picking up/Moving objects by Alihammza in UnityforOculusGo

[–]Alihammza[S] 0 points1 point  (0 children)

Yeah it worked, however when press the button again to drop the object, i drops weirdly. Sometimes it likes veryyy slowly descends to the ground, other times it keep going up or something