# \[SOLVED\] Vector data usage warning

**URL:** <https://forum.playcanvas.com/t/solved-vector-data-usage-warning/14335>\
**Category:** Help & Support\
**Created:** [August 10, 2020, 10:27pm UTC](https://forum.playcanvas.com/t/solved-vector-data-usage-warning/14335 "2020-08-10T22:27:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeXXik](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/lexxik/32/6953_2.png) [@LeXXik](https://forum.playcanvas.com/u/LeXXik)\
**Post date:** [August 10, 2020, 10:27pm UTC](https://forum.playcanvas.com/t/solved-vector-data-usage-warning/14335/1 "2020-08-10T22:27:33Z")

</div>

Hello,

I would like to use the vector’s `Float32Array` directly (e.g. `pc.Vec3().data`). Is there a way to do it without the pesky console warning?

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [August 11, 2020, 2:44am UTC](https://forum.playcanvas.com/t/solved-vector-data-usage-warning/14335/2 "2020-08-11T02:44:12Z")

</div>

Vec3 no longer stores it’s data as a Float Array hence the warning.

---

<div class="post-metadata">

**Author:** ![LeXXik](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/lexxik/32/6953_2.png) [@LeXXik](https://forum.playcanvas.com/u/LeXXik)\
**Post date:** [August 11, 2020, 8:37am UTC](https://forum.playcanvas.com/t/solved-vector-data-usage-warning/14335/3 "2020-08-11T08:37:23Z")

</div>

Ah, I see. Thank you, @yaustar! The warning message only suggested that it is a private API, hence I thought I can still use it. I now see that it actaully creates a new `Float32Array` whenever I try to read that property:

> <https://github.com/playcanvas/engine/blob/d3040d14ddd0eab10cb097d7b235e44ff0950689/src/deprecated.js#L262>

So, if one wants to pass a vector to shader, the proper way would be the following:

```javascript
var vector = new pc.Vec3(1, 2, 3);
var data = new Float32Array([vector.x, vector.y, vector.z]);
// Float32Array(3) [1, 2, 3]

```
