Skip to main content

All 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 ...
Madswint's user avatar
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 ...
Salvatore Daniele Bianco's user avatar
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 ...
Feefs's user avatar
  • 21
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 ...
Martin Anderson's user avatar
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 ...
Spectral Visions's user avatar
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, ...
Adele Mammadova's user avatar
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 ...
Ishaan Masil's user avatar
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 ...
TheCodeMaker's user avatar
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() { ...
Joshua Kidd's user avatar
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 ...
skaptilian's user avatar
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 ...
sodanet's user avatar
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 ...
Enorrav's user avatar
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 ...
Anna's user avatar
  • 31
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 ...
GreekRussian's user avatar
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 ...
Kevin 's user avatar
  • 25

15 30 50 per page
1
2 3 4 5
24