All Questions
352
questions
0
votes
1
answer
79
views
Unity 3D - Raycasts wont register in time if player has high enough velocity
hope someone here smarter than me can figure out my mistake.
I have a simple platformer game using raycasts to check if you’re standing on the ground. I tried colliders, but started using raycasts to ...
2
votes
3
answers
77
views
Simplest way to test whether a Vector3 point is inside a game object in Unity 3D
My purpose is to approximate an irregular, non-convex collider with a set of box colliders. In order to do this I want to write a bool IsPointInside(Vector3 point) function that test if point is ...
2
votes
0
answers
32
views
How are the feet established in inverse kinematics?
So, I'm working on a game in Unity, It was a 3D game. and I was intending that the player character uses inverse kinematics and prodedural animation, and stuff like that. To be clear they don't have a ...
1
vote
2
answers
93
views
How do I properly reflect a laser off of a collider in Unity 2D?
I'm trying to create a game that involved shooting a laser at objects and having that laser reflect off objects, but the laser seems to go through objects sometimes. I've noticed that the second ...
1
vote
0
answers
28
views
Raycast not hitting enemy
I'm trying to make a player attack script so that when the mouse clicks on the enemy within a certain range it will call the attack enemy function (which then goes on to call a take Damage function ...
1
vote
0
answers
36
views
C# Unity: How do I make Grappling Hook swing from building to building?
I need to make a 'Spiderman' game using Raycast to make my character move with a grappling hook/spiderweb swinging motion, and I need to use a linerenderer to show the spiderweb. With my code below, ...
1
vote
0
answers
42
views
Why does my Unity Raycast (for player weapon) pass straight through enemy colliders sometimes, and hit them correctly at other times?
I'm working on an FPS game in Unity 2021.3.13f1. The issue I'm having is quite simple, sometimes when the player shoots, the Raycast will just go straight through the enemy collider whereas other ...
1
vote
1
answer
90
views
Unity draw.ray doesn't work, though it seems the code is being run
When the script runs, the Debug.Log("Ray drawn") line works, but no ray is drawn. I have already tried changing color, distance, and the position of both the object and the ray. It doesn't ...
1
vote
0
answers
46
views
Having trouble with my Raycast. How do I fix it?
Can anyone show me what I need to do to fix the Raycast? I'm trying to get the enemy to shoot when they are behind the player. I wrote this but it's not working.
private void BackFlash()
{
...
0
votes
1
answer
53
views
UI Text not clearing after focus loss on interactable item
In my Unity project, I created a character control script, which includes a method with a ray cast to check, if the player is currently looking at an interactable object. All objects that the player ...
0
votes
1
answer
342
views
Raycast doesn't hit UI objects
I have the following problem:
I have a scrollview that is populated with Panels. Now I want to be able to rightclick between two panels and create another panel at that position. All the panels are ...
0
votes
0
answers
62
views
Unity - Capsule Cast not working properly
I'm trying to use a capsule cast to prevent my player from moving through other game objects in unity. However, this only works for the front of the cube (what I'm using to test it) and even then ...
0
votes
1
answer
101
views
Raycast not hitting at correct mouse position
Think this is a very simple issue but need some fresh eyes - the event from my SelectionManager(showing UI element) only works when the mouse is in slightly the wrong position.
I'm a rooky and my ...
0
votes
1
answer
77
views
How do I reference a script from the Gameobject my Raycast has hit?
I have been trying to reference the script from the gameobject my raycast hits, and I am having trouble getting it to work, what is supposed to happen is when the Raycast hits a gameobject, it will ...
1
vote
2
answers
164
views
Unity - Make crosshair appear when hovering over object
I've been at this for a few hours, I'm trying to make it so when shooting a raycast and it collides with an object with a certian tag, the crosshair is enabled, and if not hitting the object with the ...